How about
MD5(CONCAT(user_id, 'a secret salt'))
If you have 9 trillion users, there is one chance of 9 trillion of two users having the same MD5. But it is 32 hex digits.
The builtin UUID is "type-1", which implies that it has a time component. Notie how much of two uuids is the same:
mysql> SELECT UUID(), SLEEP(1), UUID()\G
*************************** 1. row ***************************
UUID(): b1a32a13-7f73-11e9-baa3-e4a7a03bbe24
SLEEP(1): 0
UUID(): b23bc508-7f73-11e9-baa3-e4a7a03bbe24
Even so, 7 out of 32 characters are different after only 1 second.
Here's a millisecond delay:
mysql> SELECT UUID(), SLEEP(0.001), UUID()\G
*************************** 1. row ***************************
UUID(): 074ca3bc-7f74-11e9-baa3-e4a7a03bbe24
SLEEP(0.001): 0
UUID(): 074ccdc5-7f74-11e9-baa3-e4a7a03bbe24
Running UUID on different machines will yield a bunch of other digits being different.