To state the obvious, hunters regularly and successfully harvest bears with a handgun when they are the hunters and not the hunted. Even elephant have been harvested with a handgun. With that said.....
For aggressive bear protection, blacks or grizzly, forget about a handgun unless you are an accomplished shooter with nerve. Flinch once or twice and you are done. The verified documentation of stopping a charging bear with a handgun are very rare. I only recall one specifically with a .357 that was verified with video by Fish & Wildlife in Alaska and it took all six to do it. There are other incidents, but not many. The odds are greatly in favor of the charging bear when the average hiker is armed with a handgun. The one advantage of carrying a handgun for bear is that you may (falsely) feel secure enough that a bear senses you are not frightened and leaves you be. Bears don’t naturally go looking for trouble.
Picture a large mama bear who feels her cubs are threatened and charges. She comes at you at 30 mph from 40 yards away. You have only a few seconds to react, aim and shoot accurately. Under those circumstances, it takes a cool head to react effectively with a long gun, let alone a handgun.
A 12 gauge or large caliber center fire rifle is what the average woodsman needs if one is determined to draw down on an attacking bear. A long gun is 10x easier to shoot accurately and can be employed nearly as fast as a handgun when shoulder carried upside down. Google African Carry.
If it came down to me facing a large and angry bear with a 9mm / 357 handgun or bear spray, I would choose bear spray. The best bear protection is to be aware of your environment and act accordingly. On the rare occasions I armed myself for bear protection (Alaska), it was a 338 Magnum Winchester or 45-70 Marlin rifle.
Guns and bears are an entertaining and opinionated topic, but bear attacks are uncommon. You have much more to fear from 2 legged animals. For these bipeds a handgun is appropriate as the sight of one is quite discouraging to them and usually enough to make them look for easier prey.
Regarding B.C., check with Canadian authorities in advance as there are a few hoops to jump through to get a long gun into Canada legally.