I'm aware of a few cases where coders used a pseudonym for attribution instead of their real names.
One thing I've wondered is if attribution is done via a pseudonym, who owns the rights to the code?
United States copyright law acknowledges, and accommodates, anonymous as well as pseudonymous copyright holders (see U.S. Title 17 Ch 3 Sec 302, for instance). The author (or their employer, as the case may be) hasn't automatically surrendered all rights to the work.
The obvious advantage of a pseudonym: you stay anonymous if you want to (even if it may become difficult if you contribute to a well known project). This means several things:
At the opposite, it means that if you make a professional-level contribution, writing a high quality code, etc., you're not rewarded personally. You can still say that it's your code during interviews, but it's much more indirect.
¹ I'm not a lawyer, so it may be inexact in your country.