If you are the admin of the Discourse instance, you can go to settings, and search for allow username in share links
And uncheck this setting:
But as @JammyDodger mentioned, it does not appear to be a feature which can be enabled/disabled within a users profile.
There is a feature section on this forum where you can request this feature.