When it is "my" community - by my own sense of ownership - I message the person right away. Something like
Your username is not appropriate for our site. Perhaps you meant it as a joke, but it could be painful for many of us. Please change it now.
If I am a mod or admin, I do this by pm and if I am ignored, even for just a few minutes, I'll send a stronger message.
I don't know your reasons for choosing that name but it can't be on this site. If you don't change it, you'll be kicked.
And I act on that, usually in consensus with my fellow mods and admins. I have done this more than once on a server of mine. Most people do change quickly (sometimes with some embarrassed mumbling about discord and their gamertag) or leave the server.
If I'm not a mod it's the same process except I have to message an admin to report the name and say what I've said about it.
How what about when I don't own the site in any way and don't feel I can take action myself? I would still message the person, but probably more publicly, since I would not be entirely certain that my preferences are the site preferences. I might word that more like
I find your username really inappropriate. Perhaps you meant it as a joke, but it could be painful for many of us. Please change it right away.
If others feel the same way, the name may well end up changed.
I wouldn't use any of this for Trolly McTrollface. But names that contain racial slurs, incitements to violence, hateful words for any group of people (even if the person is a member of the group), or just insults in general, I will call out. Also real names that are not yours. (One of my servers attracts people who think it's hilarious to use the names of people who are famously opposed to the aims our groups work for.) You have all the words in the universe for your user name. If you don't want to use your real name, that's cool, but there's no need to be rude or offensive, and being a joke doesn't change that.