I put on my "Momma-Frown" and say in a low "deadly-serious" voice. "No name calling." I do this with my son. I do this with my hubby. I do this with other kids. And other adults [within reason] too.
If the kids aren't old enough to know what name calling is, or if they are curious about the words themselves, I straight forwardly say "Do YOU like to be called ... ?" Because I am not using a light-heartedly-funny voice, they of course dont. Then I say something along the lines of "Do Unto Others As You'd Have Done To You..."
If its the word they curious about, I explain it. For example, poopy-head is someone who's head is filled with excrement. Is YOUR head filled with excrement? Is theirs? No? I thought not.
Because I am not laughing or enjoying myself, kids dont either. And nowadays the "Momma-Frown" is all that is needed for my son, or even his playmates in most cases. [And from across the room he gives me "the look" too!] :LOL
PS. When my son name-calls an adult, or a child name-calls me, I tend to add a quiet discussion [at what ever level neccesary] about RESPECT too. For example my best friend's 4 yr old was "trying out" some name calling on ME!? So I just quietly told him not to call names and to not speak to me disrepectfully, etc. He did it one more time a week later and I said "Are you being disrespectful to me on purpose?" And he said "No. Sorry." And we move on to playing games.