From a comment by @Krinkle on https://gerrit.wikimedia.org/r/#/c/456190/, specifically referring to L190-192 of generateSitemaps.php:
I don't know if we want to support it, but another way would be to call wfExpandUrl() on the value here. That is effectively the same as what you have, but with a few minor differences: It is only prepended if the cli parameter isn't absolute already. We don't need to remember to prepend each use of $this->urlpath.