I agree get some spray. But does it work on snakes? If you really want a firearm, take the course.
I agree with the poster about carrying a long gun on hikes. They are pretty heavy. I wouldn't want to, and no, you can't use it as a walking stick.
A "hand" shot gun could be your answer. A revolver that uses 410 shot gun shells. Would be just the thing for snakes as the shot spreads out, and makes hitting them easier. But they do not have much range, you would have to be pretty durn close to do anything other than scare one. Shot guns don't really "Reach out, and touch" things. About 10 feet is all the "hand shot gun" is good for. But they do kick some.
Maybe you could look at a Taurus Judge. Or S/W Governor. They use 410 shells.