I almost exclusively use racial slurs when joking.
I'd rarely use racial slurs in an insulting manner, unless the other party decided to make it about race first.
However, I'd never say "the n word", even in a formal setting, even with blacks around, even if it was only blacks around...