As others have mentioned, that is accounted for in the rules.
My immediate first reaction was also that it would be interesting to have a variant that is the same except you are allowed to checkmate, except then I realized the recursive nature of how board positions are evaluated makes that problematic. For instance, if there's a mate in 2, the first move of the mate in two is now certainly the "best move". Creeping up on a checkmate without ever making the "best move" until the very last one might actually be harder than the win condition based on strangling the opponent described in the current rules.