Unpopular opinion: FOSS projects shouldn't bother hosting under US jurisdiction. There's absolutely no upside for a nonprofit, and our supercharged lawfare culture causes endless headaches for everyone -- even the most innocent software in the whole world, like a symbolic algebra library.
It's so depressing to see well-meaning philanthropy apathetically trampled by thugs in suits.
The terms of DMCA are not much different from those in other countries. The WIPO copyright treaty caused many of its signees to practically copy the text from the DMCA into their own legal system.
Perhaps you can host this stuff in countries that do not care much about copyright (China, Russia, etc.) but those usually come with their own problems.
Instead of avoiding countries, you should avoid hosters that will take such extreme measures following DMCA takedown requests. There are companies out there that will have a human read your counter notice and care about the legality of this whole situation, you just have to find them. That means avoiding big players like Github and building your own bespoke host, probably behind a Cloudflare or similar tunnel to prevent your website from going down because of DDoS attacks and traffic spikes, which will add significantly to hosting costs, especially if the library becomes successful.
To be honest, this sounds like solving the wrong problem. Hackerrank and their friends are the problem, not the people using Github's free service to host their documentation.
My OVH server in France got disconnected a few years back because one site had a link to some malicious material. Had to reply via email to get them to reconnect it. That was back in March 2017.
It's so depressing to see well-meaning philanthropy apathetically trampled by thugs in suits.