This exact thing is called "washawasheo" or "washawashear" in (Mexican) Spanish. It would be cool to know what languages have this, as I'm pretty sure not all of them do (Russian doesn't, for example).
> The Greeks used the term barbarian for all non-Greek-speaking peoples, including the Egyptians, Persians, Medes and Phoenicians, emphasizing their otherness. According to Greek writers, this was because the language they spoke sounded to Greeks like gibberish represented by the sounds "bar..bar..;"
https://en.wikipedia.org/wiki/Barbarian
> The Greeks used the term barbarian for all non-Greek-speaking peoples, including the Egyptians, Persians, Medes and Phoenicians, emphasizing their otherness. According to Greek writers, this was because the language they spoke sounded to Greeks like gibberish represented by the sounds "bar..bar..;"