Such a tactic might work, but I don't know about the reasoning. They might seriously not know that they're doing anything other than kidding around. It's a bit much to assume they don't have a better nature. Sometimes people just adopt a behaviour that they learned in one environment at some time or another and never grew out of it or invested enough thought to realise how it might affect people around them. Maybe that's too much sympathy for someone being shitty but I just don't know if I'd start with the assumption they have no better nature when there really might be a decent person behind it all that's simply never been shown what they're doing in a different light.
If it comes from someone they trust and wouldn't want to offend they might take being honestly told about it seriously. Ironically though, I still think your approach could be a way to do things even if I don't agree the person is beyond redemption and just deserves it. I'd just hope it shocks them out of it and prompts them to reflect.
They might seriously not know that they're doing anything other than kidding around
After the last 8 years here in the US, I'm just about tired of people who claim to be 'kidding around' when what they're doing is being carelessly cruel.
I have never been there so I won't pretend to know what it's like but I would suggest that taking that macro level pulse of the nation and applying it to your individual interactions is going to reinforce and entrench the problems you're seeing at that larger scale.
Sure, sometimes it's very clear what the intent is and when someone is disingenuously hiding behind a feint for ideological reasons. But without the necessary context it's probably better not to assume the worst when they could just have blind spots. There's no need to be charitable or generous with people that are obviously out to cause harm but if it's not obvious, as with this story, and when there's an opportunity for a real dialogue as seems possible with OP and their personal relationship with the person in question, it's got to be better to reach out first before giving up entirely.
I worked in a workplace where a bunch of self proclaimed "Alpha" dudes were just kidding around. They ran the culture of being assholes to people and most just tolerate it because these dudes were untouchable.
Like a pregnant coworker would walk by and they'd go, "What a waste".
And if you got upset, "just kidding relax. Just a joke."
"Your mom wasn't joking last night." is my favorite response. If we're in the gutter, let's wallow there for a while, and your mom jokes bring the situation to light for all.