Some restaurants have been experimenting with eliminating or reducing tipping.[1] But I agree that it's a difficult task for the "free market" to solve at scale.
[1] https://www.thrillist.com/eat/nation/american-restaurants-do... https://www.sfchronicle.com/food/restaurants/article/tipless...