The Nominatim Usage Policy at https://operations.osmfoundation.org/policies/nominatim/ reads in part:
"Apps must make sure that they can switch the service at our request at any time (in particular, switching should be possible without requiring a software update). If at all possible, set up a proxy and also enable caching of requests." I think that argues for making the search URL configurable by the user at run time (especially when one also considers this other suggestion: "If your requirements are even larger you can install your own instance of Nominatim"). Maybe the User-Agent string could be made configurable as well (with a sensible default).