Ummmm... maybe this is a silly idea, but what about some form of "security service" that acts as a true "sea nation" (they don't put ashore, except at friendly ports)?
Ship leaves the US with security detail aboard. if they need to make landfall at a port that doesn't allow weapons, they transfer the detail over to a "security ship" (maybe an LPD?) for the duration of that stop. Security details can even rotate from the troop carrier to the protectee...
Probably a silly idea...