Something like this should be legal and not require the sniff to suggest adding a questionmark to denote a nullable type in the function declaration. MediaWiki requires php8.1+ for the latest stable version and will eventually require php8.0+ versions for all supported versions, so using union types should be supported by the sniffs of the code style.
function funcName( string|int|null $var = null ) {}
function funcName2( null|string|int $var = null ) {}