[[https://www.mediawiki.org/wiki/Manual:$wgReadOnly|$wgReadOnly]] can be set to a string to lock the database against write actions. This string can contain basic HTML that's allowed in wikitext, and most special pages -- including, but definitely not limited to Special:SpecialPages, Special:Upload, etc. -- parse the HTML correctly. Special:CreateAccount does not appear to, as shown by this screenshot:
From what I can see, checkPermissions() in /includes/specials/SpecialCreateAccount.php calls AuthManager::singleton()->checkAccountCreatePermissions( $user ) and if (and in this case, when) the returned Status is not good, it throws an ErrorPageError with the i18n msg createacct-error as the error title and $status->getMessage() as the actual error message, but I'm not sure why it isn't getting parsed correctly.