What I want is to publish the library without having to live in the terror to be prosecuted by USA justice. I am not living in USA, and I have a European nationality.
I would contact European open source organizations (like APRIL and AFUL - I am personally member of both) and perhaps the embassy (scientific advisor) of your country in the USA. See also the CeCILL license and the EUPL one.
You might also take advice from Debian or Ubuntu communities. In France, see also Systematic/GTLL.
In practice, you could choose to not care at all (it is probable that your library won't be a planetary success) or to pay a lawyer. I am not a lawyer. If your library is very successful, Google might buy your business. But don't expect that.
If you are paid by some organization to code your library, ask your client or employer for legal help.
In 2020, software patents are just a business game. For mega-corporations (see Google vs Oracle) they do matter. But for a private individual or an SME, they might not matter much.
Of course, things are different if your library is a cryptographic library (in France, it might be considered as some weapon) or just a GUI widget. In Europe, the GDPR is a serious thing and potentially impact a lot of software.
Read also the Simple Economics of Open Source paper.
See also some references inside this draft report, and this related answer.
My opinion is that it is more probable that your open source library would never be used (or you being shot by some crazy person in the USA holding a gun, or you been hit by a bus), than you being prosecuted in the USA.
I am not a lawyer
In France, see Article 323-1 du code Pénal. And the works of Xavier Leroy (including talks at Collège de France).