Right now our rule is that these are adult words not to be used before they are eighteen, and they know there are serious consequences if I catch them at it. They also know that being unkind or bullying with name-calling has serious consequences, so using the former to do the latter is very serious and they'd understand that.
I've just always felt that instead of trying to pretend bad things don't exist out there in the world, which simply makes the discovery of said bad things that bit worse. It's better if you allow them to know about these things, discuss them together and teach them about them.
We have lots of open dialogue about things like swearing, religion, extremism and terrorism, bullying, alcohol and drugs, sex education (matters like reproduction, gender, different sexualities), health, crime etc where rather than trying to completely omit things, I prefer to find an age appropriate manner to discuss them, that way we can set boundaries together and they are aware of what is expected and where the line is drawn.
My son is ten and my daughter almost eight and we've always tried to talk about all these things, when they are interested in them or experience them, or sometimes just because it's on my mind and we all find it interesting. I always feel like if something is forbidden simply because, they tend to seek it out much more than if it's just part of the furniture and we've already examined it thoroughly.