This is really weird. I just checked in the latest Matomo.zip and for me in vendor/maxmind-db/reader/src/MaxMind/Db/Reader.php in Line 149 the function getWithPrefixLen is defined.
I also checked the file on our server - getWithPrefixLen is defined on line 149 in /stats/vendor/maxmind-db/reader/src/MaxMind/Db/Reader.php - very strange
A guess by @SteveG:
Do you have by chance the libmaxminddb installed? If so, Matomo uses it instead and as the library was updated in Matomo 4 you would also need to update the C module.