My brother spends a significant amount of time outdoors (not hunting) and was attacked and seriously injured by a wild animal, with two more attacks by the same species in the same area in the same year, one of which resulted in another hiker's death. A year later my brother was charged by a moose in a different area.
Animal attacks are real, and even when you leave them alone they won't always leave you alone. That said, bear spray is much more effective than a firearm, and has saved my brother's life in the past.
Let's look at the data in aggregate instead, in order to make a decision, using the link I already gave. It's an extraordinarily low risk. I'm not even sure how quickly a hiker could bring a rifle into battery when they're just hiking along. And a pistol isn't going to stop a large animal. Whole thing seems unrealistic to me.
Bear spray, easily reachable on one's person, will be much more effective than a pistol. But data-wise, you have to consider that most near-misses probably aren't reported, that successfully defended attacks may not even be reported, and that people in certain environments will have a much greater risk than the average.
Animal attacks are real, and even when you leave them alone they won't always leave you alone. That said, bear spray is much more effective than a firearm, and has saved my brother's life in the past.