In company (and context) that makes it unoffensive to them, and any others that may hear it.
e.g. A couple of weeks ago I joking called a mate a 'bit of a tw*t' on the street for attempting to nudge me into a lampost only to realise there was a lady coming out of her drive right next to me who heard. The same word and the same context becomes offensive in different company, so I apologised to her for being stupidly crass.
With racist words, your company and context is far narrower, the narrowest it could possibly be. To say something like that on film indicates a remarkable misunderstanding of what is and isn't acceptable. I would never use the word 'P*ki' in anything other than a situation where I was pouring scornful humour on the idiots who would use it casually.