>>291643125
>used to actually be a legitimate insult,
Which, according to Merriam Webster, was exactly the same case for the term "nerd", and is actually a common reoccurrance in history. The process of a derogatory term becoming non-pejorative is called "melioration" (which literally means "becoming better"). Examples include: 

"Freethinker" used to refer to someone who doesn't think in established religious frameworks, which was seen as very negative, nowadays the term is seen as praise.
The term "marshall" comes from a German term referring to a lowly groom (as in stableman) while nowadays it is among the highest military posts you can get.
"Ratatouille" comes from the French term for "leftover food", except meaning something even more derogatory, but nowadays it's a delicacy.

Even demonyms that started as straight up insults can undergo melioration.