In any way you have to go into the wild, you will have a lot of more important things to carry and only limited weightwise resources for a gun.
I live in "rural" Alaska. I get out about 340ish days a year "into the wild"; I do take vacations hence not the full 365. When I look out of my living room windows I can see for miles with not a human soul in sight. I walk out of my front door and go for hours long hikes. I go for days long canoe trips in the summer.
I never take a 9mm anything out with me. (I have owned one once or twice over the years, trying to see why I would want a 9mm anything; always sell it, as I find it pointless to own one for where I live and what I do, preferring different chamberings as more practical.)
22lr, yes often. I do carry extra rounds of .22lr in my fanny pack. And extra ammo for rifle and other handgun. And I pretty much always have two guns and bear spray. (Note: bear spray only when it is not too cold, negative double digits, don't want the canister to explode and envelop me in a pepper spray cloud!) And bear spray works on moose too.
Funny thing is that I have never HAD to use anything other than the bear spray out in the wild to save my bacon. My closest bear encounter was at 4 feet.
Since I "Bug Out" on a mostly daily basis, one can carry as much as one can physically manage. I have packed out a moose hindquarter and my gear for miles in the mountains.
Depending on what you are considering, I would say that skills are far more important than what one carries. However, having a knife, a first aid kit, some cordage, a way to start a fire and to obtain clean water, some food, and a firearm are a good start; in my neck of the woods, I consider bear spray as an important item.
So now the short version:
.22lr.
From my experience "into the wild" I have used it/.22lr on numerous occasions to my benefit.