For close encounters, I'm in favor of whatever shoots well and has adequate capacity for speed dating. In my case that's a full-sized 9mm of some flavor. I have an XD in .40, but I don't shoot it well. Too snappy. I have a PT911 (9mm), but I'd prefer a CZ-75B.
However, that's more one-dimensionally focused on SD.
For more versatility, I would probably reach for the S&W 586-7, seven rounds of .38/.357 goodness from a four-inch barrel, broader range of applications, braod spectrum of loadings, and the brass doesn't wander off.
For longer term fan crapage, I'd be inclined to seriously consider something in a .22 pistol. No, you're not going to reload the brass, but an epic stockpile of ammo can be had for a fraction of anything else. Not advised for bear and elk, but it has consistent utility for tree rats, ground rats, fat rats, river rats,the occasional very-close-up deer, and so on. If you're trekking, a couple hundred rounds carries better than half as much of anything else.
My immediate candidates are a Ruger MkII or something in a similar flavor (Colt Woodsman, etc.). Good accuracy at reasonable ranges.
Thus, depending on the scenario, a 9mm service pistol for SD, a S&W 586-7 for SD + hunting, or a .22 autopistol for long-duration stayin' alive.