My advice would be not to make glasses out of wood so I'll put that out there right at the start.
The only sure-fire ways of waterproofing wood are to completely encase it in a film finish, or impregnate it with something waterproof. Both of these are possible at home, but you then have to worry about the food-safe aspect of whatever you're using. I don't want to overstate this since I side with the argument that nearly all finishes are safe for direct food contact once fully cured*. However, alcoholic beverages present a particular concern since of course they contain two main solvents that would be in contact with whatever you use.
and I've seen shellac recommended
Classic example of being careful of stuff you read on the Internet. I can't imagine how someone can recommend shellac for anything like this with a straight face as it is famous for reacting poorly to exposure to water and it is soluble in alcohol. It will literally be washed off the surface if used for a shot glass! Shellac isn't toxic, but still I wouldn't want to drink it in my shot.
If shellac or poly works short term, then that's fine if I just want to have them around for novelty.
A good coating of polyurethane may do you then. Just to be clear I'm referring to oil-based poly, not the waterbased kind which is a very different thing (some could work, others definitely not so best to stick with oil-based which is more of a known quantity).
You need to build a full film on the surface to ensure it is liquid-proof, so that's at minimum 3-4 coats of unthinned varnish.
Is there a finish that will last for a decent amount of time
Obviously "decent amount of time" is open-ended but for something that'll hold up longer, excluding the impregnation options which I don't know about, an epoxy coating would fit this bill. But epoxy-based finishes are not inexpensive and application can be a bit of a bear.
I don't know if you want to run a test with this and see but impregnating with wax is one of the ways traditional wood and leather drinking vessels were waterproofed in the past.
The idea is to soak the item in melted wax (you'll want to weight them down a bit so they don't float, any glass marbles in the house?) and it gets incorporated deeply into the wood as it displaces air and water. The waxy surface feel that wax will impart may be a little off-putting but waxes are famously inert and are not soluble in either water or alcohol.
*Not everyone agrees with this and some very strongly disagree (they may believe for example that no finishes are safe unless 100% natural, which is hard to reconcile with waterproofing something to hold liquid).