Pistol is not that good of a choice! Shotgun!! With laser!
Bingo. My GF has a Glock 19 for home defense. I keep telling her a 12 ga. with #6 shot is better. Mostly because it will leave a nice hole, and won’t go through the wall into the neighbors house possibly wounding or killing someone there. 2nd even if you don’t get a direct hit, something will get them plus if you don’t choke it the spread will increase the impact zone.
For concealed carry I will gladly take the 9, but in the house give me the shotgun every time.
It depends on the individual circumstances.
One big advantage of the pistol is it can be held with one hand, leaving the other hand free to open doors, grab kids, use phone, etc.
The best home defense firearm is the one you own, have practiced with, know how to use effectively. If you own one and have not been trained, and practiced, it is nothing more than expensive paper weight that can be used as a close quarters club.
Gunner