2 options that come to mind:
How the API does it - We have a "Special:DisabledPage" or similar, and to disable an extension, in LocalSettings.php you can do
$wgSpecialPages['ContributionHistory'] = 'DisabledSpecialPage';
Else, a global array variable, key is the special page name, value is the message to display to users
Version: unspecified
Severity: enhancement