Unless you can find something which revokes a statement in the Treaty of Tripoli - and given 200+ years it might well have changed - you can't apply your malicious reading because the US has said it does not have hatred or ill-will regarding the tenets of Islam.
Specifically, the US Senate unanimously wrote that the US "has in itself no character of enmity against the laws, religion, or tranquility, of Mussulmen" (that being the older term for Muslims).
That nitpick aside, your statement is still true - the loophole would be to declare that, say, the tenants of the Wahhabi branch, or the Ahmadiyya branch, of Islam are not part of the true Muslim faith as meant in the Treaty of Tripoli.
There is no requirement that the U.S. be a party to the war, or that the targeted individual be enemy or ally. All that is required is that they be a potential combatant in any war or emergency.
The U.S. could target a South Korean soldier at a defense conference in the U.S. South Korea is still at war with North Korea, so that's a soldier, on the job, during a war. All the requirements are met. It does not matter one little bit whether the soldier is actually a danger to the U.S. or anyone associated with the U.S. It might cause a diplomatic ruckus, but the U.S. is allowed to do it by the 5th amendment.
I gave no such example. The person targeted under the loophole does not have to be an enemy.
The requirement is that they be in military or militia service during a war or public crisis. Any war. Any crisis. If you are shooting Martian invaders with a slingshot, you fall into the loophole. If you are an Indonesian soldier delivering drinking water to tsunami victims in Indonesia, you fall into the loophole. Get it?
I understand your distinction, and I stand corrected in my use of the term "enemy" when it doesn't apply, but my point still stands. There is a minor sliver of an exception to your loophole, because the US has declared that some things are not of themselves causes for "enmity", one of which is adherence to the Muslim faith.
If you say that being in the militia is a requirement of Islam (and a quick search of a Koran does not find that to be true), then it was equally true when the US signed that statement; and I have no doubt that some Muslim somewhere was involved in a public crisis even at the time it was being signed in the Senate.
But change one single iota of your premise away from specific treaty terms, or clarify that the US has the ability to declare someone to not actually be a Muslim, then you're golden.
You also need to be careful to not trounce over other treaties, like the UN Charter. That's not hard, if the last 50 years of US military interventions is any indication, but it's not so easy as only using the language of the loophole.
You're arguing about this as though the people exploiting loopholes in the law to kill people by executive order without so much as a single judicial hearing are going to honor treaties as well. Here's a hint for you. Research all the treaties the U.S. made with the native Indian tribes.
You are completely missing the point. This doesn't have anything to do with Muslims or Islam. It has everything to do with some psychos in the U.S. government ruining the rule of law for everybody in the entire world, because it has some tiny benefit just for them in the short term.
The 5th amendment basically says that the normal rules do not apply in a war or public safety threat. Therefore, if you, as an agent of the government, wish to operate outside the rules, you just create a war or public safety threat. That's what we call a perverse incentive.
Specifically, the US Senate unanimously wrote that the US "has in itself no character of enmity against the laws, religion, or tranquility, of Mussulmen" (that being the older term for Muslims).
That nitpick aside, your statement is still true - the loophole would be to declare that, say, the tenants of the Wahhabi branch, or the Ahmadiyya branch, of Islam are not part of the true Muslim faith as meant in the Treaty of Tripoli.