... You're not going to carry a rifle or shotgun when you go on a hike. If you can only have one gun, get a handgun and always have it with you ... if I could only have one gun it would be the Glock 29.
I've been a firearms instructor for about 40 years. I've taught thousands of people to shoot. I agree with the first two statements here, but strongly disagree with the recommendation of the Glock 29 as a first gun for a beginner. It's a strongly recoiling hand gun due to the caliber and the weight/size of the gun. Many experienced shooters find its recoil to be too much for them. Yes, you can train with lighter loads and then carry heavier loads when going in harm's way, but even the light loads in this caliber will make it hard to learn, and unpleasant for the average new shooter to train with. And training is essential if one wants to learn to shoot a handgun quickly and accurately.
There are bears in CA but only black bears which are not nearly as tough or as large as their northern cousin, the grizzly. One is at much more risk from two legged creatures than four legged creatures, even in the outback areas that overlanders crave. A 9mm with hard cast bullets will handle both risks in the lower 48. If Canada or other places where there are large, thick skinned, heavily muscled animals (like the grizzly) is the destination than the .44 mag should be considered, because it's more powerful than the 10mm. It's not about getting off three rounds as fast as possible, it's about delivering them ACCURATELY into vulnerable areas.
No matter what handgun/caliber you get, I suggest that you get professional training on how to use your gun. It's expensive, but it's worth it. it's far easier to learn new habits than to unlearn the bad ones that will probably come from training from a friend or neighbor 'who owns a lot of guns.'