The logic you are trying to achieve can only be achieved on the receiving end of the hyperlink - you cannot trick a browser into visiting one URL but telling the user they're on another, as that would be a massive security risk.
If the service you are linking to has implemented referral tracking in a sensible way, a cookie will be planted as soon as the user lands on their site, so that removing the query string would have no effect on how the referral is tracked. The target site could even tidy up the URL themselves, redirecting users to a version with no query string, but again, this is something only they can achieve.
If the target site is implemented in such a way that removing the query string is enough to rob you of your referral fee, it is them that is robbing you, not the users.