Regarding close quarters, I do find a legal-length pump shotgun unwieldy for searching the typical home, especially if I am the first one through a doorway, but a minimum-legal length rifle is notably handier. I work night shift big-city police patrol, and so I do have to clear buildings, no choice in the matter, but clearing a building is one thing, fighting is another. I don't want to go into what I know is a gunfight with a mere handgun, if at all possible! While clearing a building, as a team, not everyone is going to have a long gun, and one with a handgun can be the first through a door, or to go around a tight corner, while the shotgunner/rifleman covers him.
If I must defend my own home, without the benefit of co-workers similarly trained, I am going to stand and fight, not clear the house, and that means a long gun is the preferred instrument, with the handgun(s) playing a back-up role.
Some of us may have to go and round up children or elderly family members, and need a free hand for that. That may well be the time for a handgun, but I still want a rifle available.
True story: Exactly one year to the day after I had cleared a house, pursuant to a burglary in progress call, where a single mom lived with her two children, she called again, about another burglary in progress. While en route, the hair on the back of my neck was at full attention; this was creepy. I knew from her contact with the dispatcher, that the mom was with her kids in the bedroom at the top of the stairs, and that I could see the bedroom door from the window by the front door. Upon arrival, at which time I deployed my carbine, she had to descend the stairway, to the front door, to let me inside. I sent the mom to the street, as back-up was arriving at that time, and I immediately went up those stairs, in dynamic entry mode, to make sure the intruder did not have a chance to get to the kids. I shut and barricaded the door, and let other officers clear the house, while I stayed put in that bedroom with the kids. Anything other than a blue uniform coming through that door would have been a target, and I was able to tell my co-workers, via radio, where I was located with the kids. Yes, the break-in was real, but the perp(s) had evidently fled before we had the place surrounded.
I tell this story, not to make myself out to be a hero, but to show what one man with a rifle did in one particular circumstance. I went to the kids' location, secured the door, and made a stand, while letting a team of LE officers clear the house. I inserted myself into the role of defending the kids, as it seemed the logical thing to do at that moment in time. Why try to get the kids down those stairs, with an intruder possibly there to harm them? Better to run to the kids' location, and defend them from there, until the house was cleared by a team of LEOs.
Of course, each of us must make a plan based on our families, the layouts of our homes, our weapons, and our abilities.