One of my great pleasures living in Wyoming was being able to buy a gun, any gun, from anyone, simply by agreeing on the price, forking over the money, and heading for home. I know thay have since put in a wait time for hanguns at the stores, BUT there are still people who have a gun for sale. It's a matter of finding them. I was in Green River for 17 years and had more choices than I needed. Especially after Christmas when someone realized how much they had gone over on the budget - and got laid off. Lots of bargains were available. Pawn shops are a good source, but you need to know what you are looking at.
The answer to your OP is yes, of course you can where you live. Find someone who has what you want, agree on the price, pay them and walk away. You are a law-abiding citizen, you say, and that's all legal. And, of course, a non-law abiding citizen can do the same thing. They don't care. And when the laws change so that you and I cannot do that, they still will. Seems pretty senseless to me.
As to the need; as you've read above, there are several schools of thought here. You will need to decide which one fits your circumstance. You can get a lot of spray for the price of ammuntion, much less the cost of the gun. I've been to bear encounter programs given by the Wyoming game & fish. They lean towards a particular kind and are quite down on several kinds and tell the story about bbqing a bear that was pre-seasoned with pepper. Kinda made me wonder..

However, it was all good training and they did teach several things to do and not to do in an impending encounter. The tough time I've had is waiting to see if the bear is serious about a dinner date and deciding when I was going to pull the plug on our conversation. So far, it hasn't gotten terminal, BUT there is always that possibility, and I am determined that I will go home under my own power after our discussion. Just another choice, and you get to make it.
I never saw a bear in Wyoming in all those 17 years of living there, and I worked in a lot of those mountains, surveying. When I wasn't working, I was hunting or fishing. Saw lots of sign, some in our camp yard, but never saw an animal. Five years living and working in North Idaho has brought me probably near 100 sightings and a half dozen encounters, all black bear, closest being about 10ft. (They do have terrible breath!) My point being, if I really didn't care to have a handgun in Wyoming, I wouldn't bother to get one. Pack a can of spray and keep the rifle handy. If you do have a bear encounter in Wyoming, it is just as apt to be a Grizzly as a Black bear. Whatever you do, you WILL be bettin your life on it. I'm in the wild a lot when I am not hunting. I always pack a sidearm capable of dispatching whatever becomes life-threatening. Again, it is a choice, and I choose to live or make a big hole in whatever is killing me. I would never get an automatic, as I have never owned an automatic that
never jammed. I choose a revolver for both me and my wife. She did not have a choice other than to accept my choice - leaves me responsible, which is where I see myself. She packs a 45Colt Ruger Blackhawk Bisley at standard pressures with a WFN hard cast bullet and clips branches off of tree stumps at "bear encounter" distances. Plenty of punch and not a lot of crash, bang and concussion. I pack a 41Mag Ruger Blackhawk Bisley with a WFN or WLN hard cast at magnum pressure. Just our/my choice.
Regards,
Sweetwater.