Most folks are surprised at how "flat shooting" a standard 9mm is at those ranges (or even longer distances).
Cheap to shoot (assuming you can find ammo in today's politically-driven buying-frenzied market), and that means cheap to practice with, which of course builds the skill and confidence needed to make those kind of shots.
A good .357 would be my second choice, only because of the increased ammo cost and ferocious muzzle blast. The .357 cartridge would be more effective than a 9mm if you can place the shot, but due to minimal practice, most folks cannot shoot it very well. A longer-barreled, adjustable-sighted, stainless-steel S&W or Ruger .357 is a great outdoors/woodswalking/hunting handgun.
"Placement is power" -- seen in an article by Stephen A. Camp
(RIP, Mr. Camp; you will be remembered, and missed)