Calling xdmp:spawn or xdmp:spawn-function can be a little faster than corb, simply because it avoids the round-trip network.
If documents are organized for him, xdmp:collection-delete or xdmp:directory-delete can also be faster. But collections or catalogs should be about 1000-100,000 documents ideally.
Finally, if you want to get rid of everything, it would be much faster to clear the forest or database. It may even be faster to export the material you want to save (possibly using XQSync), clear the database, and then re-import.
source share