Instead, I'd recommend using Cloud Functions for Firebase. You can create a Cloud Function that is triggered when a user chooses a username, perhaps by creating a temporary path in the database and using a database trigger. Now if you're not familiar with Cloud Functions or Node.js, there will be a lot of new information to learn up front, but you will discover that there are many use cases for Functions, so it's worth learning.
Thanks for the thorough response, @JenPerson! I intended including 'safe' in the question, so I'll be going with your second suggestion.
To be clear, let me say up front that I do NOT recommend you do this for your use case. But in general, you can allow unauthenticated users to access parts of the database by setting your security rules for that path to true:
You would not want to do something like this because you don't want to give the public access to everyone's usernames.