The history of racial slurs is pretty interesting, too.
For instance, “Nip” is generally considered to be a slur, but it seems to have come to English from the word “Nippon” or “Nihon”. “Nipponese” in English would be “Nihonjin” as best I can tell in Japanese. “Nipponese” was used as far back at the early 19th Century (1), but “Nip”, as a slur, seems to have arisen after WW2.
Given the changing nature of language, I guess it’s not surprising to see random unrelated words come to be viewed as slurs. In this case, there’s even misleading “evidence”, given that Nambu pistols in the later years of WW2 were absolutely terrible firearms, due to time and resource constraints as Imperial Japan lost access to imported resources.
1: https://books.google.com/books?id=WiEYAAAAYAAJ&pg=PA584&dq=N...