40 is great, and 45 in a 1911 makes angels sing, but my go-to is a P229 in 9mm. It's a compromise caliber, but it's a medium sized weapon with a 10 round mag. 10 round is the max here in CA. If a Judge was legal in CA, it'd be within 4 steps of the bed instead.
on edit; if you aren't going to shoot it much and just plant it for protection, a revolver is the way to go. Right now I keep a S&W 686 (357 mag) loaded with 38 hollow-points in the four step range. It'll shoot the 357 fine, but that round is a bit much to be spraying around the house in the dark. A 38spl HP is a good round for the hallway. It all depends what you're using it for. For that matter, shotguns make a big bang. I just don't care for the length.