Limit Login Attempts BEFORE PHP is executed?

If the “attack” is distributed, the only thing you can do is to change the url of the login endpoint. This should be easy to do with web server config (block /login and friends, map some other “slug” to wp-login.php). This will also break the automatic redirect from /wp-admin to /login which is a good thing in this case.

Don’t forget to handle xml-rpc as well in the same way.

Of course this answer is not great if you have many users, but it can work if the number of users is small.