It's genuinely pretty tricky. There seems to be a valid use case in filenames if it needs to include both an English and Arabic or Hebrew component, for example. Which, if you work with bilingual documents between countries, is not unusual.
It's part of a broader question of visual strings having multiple unexpected Unicode representations, including Cyrillic letters masquerading as Latin, etc.
I've never heard of any solution, except for when a text component is supposed to be machine-interpretable (e.g. a file extension or domain), for the computer to display its interpretation in a special way (via icon, showing the extracted extension below the name, bolding the domain, etc.).
They're not great solutions, but there don't seem to really be any alternatives either.