OP, might want to read this: Handguns for Protection in the Field.
Make sure you have the proper bullets and the ammo is reliable/tested (you would not want a dud/misfire in a semi-auto at that moment). There is a lot of muscle and bone to penetrate in a bear. If a head-on charge, there's very little of the vitals exposed. If all you can get is a headshot, you need maximum penetration as the skull is thick (bullet deflection) and the brain itself a small target deep inside the skull. Not sure if you can get out of the way of a charging bear protecting it's cubs before it dies of gunshot wounds.
What is just as important as being armed is having first aid stuff like QuickClot for bleeding, bandages (Israeli battle dressings), and 1/2" SteriStrips for lacerations and practice using them. All available on Amazon.
I am a revolver guy ,,,, but the more rounds of Glock 21 .45ACP
makes the most sense,,,,, since the 10mm was not in the question
,,,, but if it was; then the 10mm would be my answer
Don't do this if you bag one. :smile: