Maybe there are occasions when swearing is appropriate, but never as an excuse purely shock or offend.
I'm Australian, so to us swearing is somewhat more casual and accepted.
But generally the entire point is that it is inappropriate. In my examples above, Sarah Connor swears because she wants to shock and she wants to offend.
I don't think it matters if it's "appropriate". It just needs to be authentic.