Possibly related, I moved last Summer and it took me until January to find a barber I've now been to repeatedly. I have really high expectations and before moving I had been going to the same shop in my previous city for more than a decade, and was on a first-name basis with my barber there and his wife and eldest son and sometimes hung out with him outside of work (mutual interest in classic cars). For me, the tip is absolutely a direct and personal thank you gift, because I have very high standards not many people can meet, and few that do get it right the first time and as a matter of course. I generally tip well, though.
All barber shops are different, but usually the person cutting your hair is renting space from the owner of the shop, who may set prices. You can use this knowledge to affect your willingness to tip (or not), just in case you're not tipping because of an assumption that may or may not be valid.
> charge for what it costs
I think that's a bit tricky, I don't think the true cost of a haircut is fixed day to day. On slow business days when there is no line, a slow and careful haircut doesn't really 'cost more' than a quick haircut because the daily throughput is the same. But on days when there are a lot of people lining up for cut, slow haircuts will reduce throughput and therefore have an opportunity cost. (This is for a walk-ins only barber.)
That's a direct 1-1 transaction. You are getting a hair cut, so if it's good, you'll come back. If it's bad you won't. Charge what it costs and give the best service possible.
Granted if they go above and beyond maybe I would tip (buy yourself a beer as you say, but it would have to be more than "they cut my hair").
That's the slippery slope though, whereby if you don't tip you are deemed to not be happy with the service, and so the emotional imperative is to tip to not offend.