Pro Tip: When visiting Japan, dress and comport yourself so you don't look like you should be thrown in jail, and it will happen a lot less often.
As a Mexican friend puts it for Mexico: Dress as the police should believe you.
Or dont go to an authoritarian state where something like this is accepted. Im astounded at people defending this. If it was china people would see this is messed up
That's the advice I give to anyone traveling internationally. You get treated a lot differently when you wear khaki slacks and an Oxford shirt (more professional rather than stylish) - even if you're wearing sneakers.
The more bland the colors, the more you blend in and easier it is to flow through places.