Allow users to register as a higher role than default with code

You could combine your two ideas- generate a code and send them a link to a sign up form with that code as a query string in the url. match the code with the email address they enter when they sign up, then delete it once sign up is complete so it can’t be used again.