44 mag or bigger for bear. If you need more than 3-6 rounds you didn't need to use the gun in the first place. Bear spray is a much better tool in the vast majority of situations.
Actually, looking at the use case data, bear spray works just fine on bears that aren't particularly aggressive and may not need anything at all. That's how it's used 99% of the time and where it gets it (false) high-efficacy ratings. Rocks, slingshots, etc are as effective as bear spray in those cases.
The bear spray failures seem to occur in cases where a bear is truly determined to make contact and attack/kill a person.
E.g., two geologist gals in 2019 in Alaska. Weren't allowed to carry a firearm on the job. Predatory black bear attack. Bear spray failed to deter the bear. One gal killed, one escaped. Bear killed after the fact with firearm. Firearm would have easily stopped this attack (predatory black bear attacks usually happen pretty slowly, with the bear probing the person first, as happened in this case).
I think the same summer, guy working on a trail behind his home in Hope, AK. Was found killed and I think partially eaten. Bear spray again had been deployed and failed.
That was one summer, in one state.
Over hundreds of cases, there are essentially zero (or zero) failures where handguns 9mm and larger are used and hits on the bear are made.
Bear spray's biggest following and promotion is from people that primarily don't want bears killed/harmed while person safety is actually secondary. Much like non-lead bullets promoted by raptor groups, using biased data to dissuade people from using lead bullets. Their interests are actually the raptors, not the people, but they also skew data to help meet their ends.