To me there is actually a logical difference from a game theory perspective, ignoring ethics:
A seeming native is a "likely potential regular customer." So you offer a lower price per visit, but in the long run make lots of money from so many visits.
A seeming foreigner is a "likely never to return customer." So there's an incentive to screw over the customer and profit-max, no downside since they weren't returning anyway.
So there is this universal capitalistic incentive to over price the Gweilo. Of course a way to soften this is to invoke capitalism again and allow competition to drop prices. But then this dives into things like price elasticity for tourists versus natives, and how clientele feel about tourists. If the local clientele are xenophobic the bar may even expel those they don't like much less charge a higher price, and from a capitalistic perspective this may be a tactic to retain ongoing regular customers.
I would argue this type of reasoning is seen throughout many fields. For example, anything involving money and the field of medicine has wildly all over the place made up pricing.
I would argue in all cases, this is in fact scummy, and the solution would be to mandate a clear pricing schedule (specifically with criteria on if and when different people are charged different prices) and thus open information availability to inform the customer. Tourists can then voluntarily say "I really want the food here, I'll pay the premium" or voluntarily say "on principle this is unfair, I'll vote with my feet and go to the even-priced competitor"
There are various discounts for things like senior citizens and military and such throughout, so none of this is a new idea.