The HTMLFormField::validate() method is documented to accept string|array for the $value, but actually any valid user preference value can be passed, including null and int.
This passes through to form field definitions that use the 'validation-callback' key, where that callback is also expecting to get an input value in the same type as the form field being defined. This is a reasonable assumption in most cases (i.e. a text type is going to be given a string), but it can also be given null.
This bug surfaces in the case of DefaultPreferencesFactory::validateSignature() which is expecting a string and breaks in PHP 8.1 with null, which it passes to mb_strlen():
Deprecated: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated in mediawiki/includes/preferences/DefaultPreferencesFactory.php on line 1711
MediaWiki version: 5c5d593c7cb2133866b266ec2c4407e5a77e0ef3