xdmp:random() is a 64 bit pseudo random generator (PRNG) with the properties of such, using FIPS compliant implementation when available.
It is the same as used internally for generating document and fragment IDS.
So in practice you cannot do better wrt to efficient generation of unique ids.
And yes this is something that most people find difficult to accept at first (myself included).
Now that is not the same necessarily as guaranteeing in some specific context and that your use of this generates unique URIs (which is ML's version of a GUID or database wide 'primary key'). To do that you have to guarantee that the only source of URIs are those you generate and that you make full use of all 64 bits.
If you want a proof to yourself that its absolutely unique no matter what is going on, then you need a transactional atomic counter of some sort.
Those are easily made (a document read-update-write-commit of single shared document) but that is horrendously slow at scale.
Another alternative if the data is batch uploaded from CSV is to use the offset (row or line #) of the record as part of the URL, and something unique about each file, like its filename.
Often CSV data itself has a column or combination of columns that represent a primary key for that dataset. That can be used as well.