I've had this.
I left the room immediately & left him to stew.
Then had a quiet word once he'd calmed down about why this was unacceptable, aggressive, how would he feel if someone else used this word to me/his little sisters etc. He was hugely apologetic.
We've had one recurrence. I'm still not sure this was my finest parenting hour, although damn it was effective, but I cheerily bombed him with the word for an hour 'can you bring your dirty washing down so your cunt of a mother can sort it, ds? This cunt was wondering what we should have for dinner, ds. Oh you want to invite your mate round? I'll just ring that cunt, his mum, & see if the little cunt is free...'
'Stop it mum! It's horrible! I'll never say it again... '
Of course he probably will, & fwiw he upset himself a lot more than he upset me. But he had to tell me why I shouldn't use it (the gist of his argument was ' it sounds like you hate people when you don't, I don't like you using that word about yourself because I'd be really angry if anyone else called you that, I'd be totally embarrassed if X or his mum heard you using that word'), so it makes it harder in future for him not to be at least slightly reflective about it, I hope.
I do swear quite happily myself, & I'm not especially precious about my dc letting rip occasionally. But I'd like them to at least use their language consciously, rather than just randomly c- bombing me on the course of a bedtime argument...