I'd like to add, what some people say as racist, might not be what you infer it to be. Clearly, if I called an ethnic group by a slur, it would be racist. But some terms get labelled as racist, when it might be more nationalist. Some English types might call me a 'Jock'. It's not racist, though it can be meant in a derogatory manner. If I was called a black Jock, the jock part would be the perceived offence, black being descriptive (this gets into unconscious bias). If another term other than 'black' was used, then yeah, it starts getting serious.
Consensual banter between friends shouldn't have bars, but it'd be a strange friendship if it was laced with ethnically racist insults, tbh. And I've have to ask, if there was a minority player in a group of friends, does the minority 'accept' the banter because they want to be part of the group, and are the group aware that they may be causing offence?
But that's just my opinion. It's more clean cut in the eyes of the law, where the context of hate is required (UK).
Incidentally, pic from a mostly forgotten film (1941), which perfectly illustrates some of the above:
View attachment 324338