The documentation is quite outspoken here:
> Only superusers may connect to foreign servers without password
> authentication, so always specify the password option for user mappings
> belonging to non-superusers.
You could use a connections as superuser and wrap the access to the
foreign table in a SECURITY DEFINER function.
Maybe it is a solution to keep CREATE USER MAPPING in a separate script
that is not managed by Git.