TLDR: I feel like guns, and even pepper spray, are overrated.
Feel safe hiking alone - generally yes. My biggest worry is that I'll slip, hit my head, and drown in a couple feet of water while crossing a stream.
I've had more than 50 run-ins with black bears (including around twenty in one year) while hiking. In almost all cases, the bear runs away. Only a couple times did the bear stand its ground, and that was when it had cubs. (Bears around dumpers are a different story!) Bears charge very quickly - at about 30mph - 44 feet per second - and you need to hit a /very/ small target or you just annoy the bear. You generally only have a few seconds from when you see a bear to when it is on you, if it's going to attack (so I'm told, I haven't experienced a charge). A handgun would be practically useless unless you're a trained crack shot, and have the gun in hand, and you're lucky.
Even pepper spray is no panacea. You have to wait until the bear is practically on top of you. Yeah, it shoots 30 feet. But it's not that accurate at that range, and it's spread out more, etc... and again, the bear will be on you in seconds. Actually less than one second.
I practiced with pepper spray. First with a big bottle that I had carried for 6 months in the side pocket of my backpack. It didn't shoot at all! (I didn't investigate why - I bought a new one.) In retrospect, the bear would have had me by the time I got the thing out and shot it anyway. I would sleep with pepper spray with me, but my understanding is that bears can smell it, and they might think it smells like food.
About humans - even as a big guy, I've met a few that made me think. But... they were guys with guns. Hunters, who seemed like (no evidence) they might have had a few while hanging out in the tree stands. I'm not sure how the gun would fare with them. (Note that most hunters I've bumped into have given me a smile and wave, this minority seemed like the type that shoot at those robot deer.)
I often hike with a friend on long hikes nowadays, but that's more about enjoying their company. But I recognize there's safety in numbers.