besides the technical implementation, duplicate usernames seems confusing to users, which is why i’ve never given it too much consideration. is there a reliable and obvious way you differentiate users in the ui? i assume the primary key of the user on the backend moves to something like email or phone number (or just a unique id key i suppose). i’ve seen some projects use a randomly generated image/sprite for this, which isn’t as reliably obvious as i’d like (not to mention not as broadly accessible).
Discord, game platforms, etc. do this with a discriminator. You're not Bob, even though that's what everyone sees - you're Bob#1337 internal to the system, and people need your "full name" to locate you if you aren't already friends.