But instead of the server accepting an arbitrary string, it only accepts hexadecimal or base64 strings of a specific length. Which solves the problem.
If the client sends only a hex/base64 string, how can the server trust that it's the result of a password being fed to a KDF?
The threat model is: Password is too long, lots of CPU is wasted, denial of service.
By only accepting strings of a certain length, the threat is defeated.
The client could send an intentionally bad password even if they weren't lying. If they lie, only the client is harmed, and in a non-new way.
So this scheme has one notable upside, and no notable downside.
There are better solutions, but this one is valid.