I’d strongly advise against steel shot. I’m not saying I have because it’s illegal but I’ve seen ducks hit with lead and it drops them way harder than any steel. If you want a lighter load but still deadly I’d advise #4 or #5 Turkey mags. They’ll roll a big Turkey or yote out to 50 yards (still a turkey/coyote and a burgaler probably hyped up on some kind of drug are two very different things.)If I lived in an apartment with paper-thin walls, and neighbors on both my left and right AND across the hall from my front door, and if the back side of my apartment faced a small courtyard with another set of 4-story apartment buildings on the other side (a pretty common layout for apartment buildings in crowded cities) THEN, and only then, would I make "lowest risk of overpenetration" a more important factor in choosing ammo than "most effective at dropping attacking bad guys."
I think I'd still go with an AR carbine shooting light varmint bullets, BUT it would probably have to be an SBR and wearing a suppressor. I don't want to shoot an unsuppressed .223 in a small apartment without hearing protection-- not even a few times. Not even in an emergency.
If I didn't want to have a two-stamp gun for home defense in my urban apartment scenario,
I think I'd go with the shotgun choice. And since I already own a 20-gauge pump, it would be that, using some kind of waterfowl load and 3" shells.