The debate is usually AR vs shotgun. Both of those are equally loud in the home, and would be a concern. My personal opinion is that a handgun is still the better choice for indoor use even though handgun rounds do typically penetrate more in building material. My thinking is that at such close ranges there is a very real possibility I will need 1 free hand and only 1 hand on the firearm. Plus a handgun is much easier to have handy, yet out of sight for unexpected bumps in the night.
I see the any long gun as a better choice when you are expecting trouble and waiting for intruders from a secure area. Which is better is another debate where I won't go now.