1) Any load that will reliably penetrate a human will penetrate SEVERAL interior walls. Learn to place your shots well and consider your fields of fire.
2) I absolutely agree on signing up for a training class. It will keep you from making uneducated firearms decisions, related to both the capabilities of the weapon and yourself. You might get talked into something that you end up hating, like I did. I was talked into a 12g for my first gun, and being a new shooter, I hated it. (and btw, take everything you hear about effectiveness of various weapons, including from your instructors, with a big grain of salt)
. Everyone has their biases, and sometimes they are surprisingly uneducated about modern ballistics. Here is a good read about the age-old "9mm vs .45" debate. http://joebarrett.wordpress.com/2010/07/05/9mm-versus-45-cal-you-be-the-judge-but-think-about-it-first/
3) A pistol-caliber carbine can be a very effective HD tool without breaking the bank or your ear-drums. However, an .223 carbine is one of the most versatile guns you can find. There are the obvious advantages it has outside of the realm of "typical" HD, but it is also not difficult to double- or even triple-tap a target a few yards away, and a couple of these to the chest aren't going to make a threat any less "stopped" than a 12g blast.
So, as far as my recommendation for a first rifle that will also have defensive purposes go, I'd recommend a 9mm carbine. With good ammo, it can be counted on to reliably stop a target. And 9mm is the cheapest centerfire ammo you can buy, so practicing won't break the bank. Plus, the muzzle blast and recoil will be minimal, which will allow the new shooter to concentrate on the basics rather than develop flinches and anticipation.