My biggest question is regarding calibre vs projectile speed.
Is a small high speed projectile going to be effective, or is a larger slower one better?
EG 7.62mm vs .40”
In lead, non-jacketed bullets, this means, mostly, hardcast lead bullets.
In jacketed bullets, mostly full metal jacketed bullets.
In .40 caliber, use heavy, full metal jacketed bullets, or, there are some heavy hard-cast bullets.
In 7.62 caliber, use full metal jacketed (fmj) bullets. 7.65x17 (.32 acp) is a bit light, but the 73 grain fmj would likely be the best. The 7.65 Mauser or 7.62x25 Tokarev with fmj bullets would likely work very well. They have significant energy and are known bone-breaking/shattering loads.
In .32 revolver cartridges, use heavy for caliber fmj or hard-cast bullets.
The best handgun .40 caliber cartridge is probably the 10mm with heavy bullets. It has a good reputation.
The "best" 7.62 handgun cartridge is probably the 7.62x25 Tokarev with fmj bullets. There is very little data on this cartridge being used against bears, it is not a popular carry cartridge in the USA, where most data is collected.
A slow projectile may not penetrate far enough to reach the vitals.
For something like a bear with thick hide and lots of muscle, I’d go for penetrating power. That means velocity. 44 Magnum would be ideal but though people like to pretend otherwise, 9mm has been shown to be effective in several bear attacks. 356 pounds is the size of a large human and 9mm will easily kill a human. It’d be effective against Black Bears too.
I never go out without my gun. That’s especially so when I go hiking.