And yes, the coast guards of those countries DO fight in wars, and have at many times participated in military operations in their nations' coastal waters. Interestingly, the original Revenue Cutter Service -- the civilian law enforcement service that is the immediate predecessor of the Coast Guard -- also participated in war prior to its formalization as a uniformed service.
The Coast Guard was never "declared" to be a military organization; it was CREATED as one in 1915 when two civilian agencies were incorporated into it and was intentionally modeled after the U.S. Navy.
The USCG is more like a military organization charged with law enforcement, which have long existed and still exist in many countries. The US Revenue Marine/Revenue Cutter Service was not a civilian organization and essentially no different from the early USCG: It was a uniformed service of the United States under the Treasury Department, and, since the 1790s, could be transferred to operate under the Navy Department when ordered by the President (usually wartime). Officers held commissions from the President, confirmed by the Senate. Congress gave the Secretary of the Treasury the authority to regulate the service, and its personnel were subject to its regulations and discipline and tried in its service courts.
Very true. Except that Starfleet's operations, ships, mission roles and even its rank structure (the suspicious absence of enlisted crewmen on the Enterprise-D) are a better fit for an armed version of NOAA.
Enlisted crew weren't featured much in the series to be sure, but they were there (O'Brien, Crewman Tarses).
Enterprise: the distinction between "the military" and Starfleet, the former referring exclusively to the MACOs
STXI: Scotty taking issue with Starfleet performing an exclusively military mission.
TNG: Picard's exact words "Starfleet is not a military organization. Its purpose is exploration," followed by Riker's statement: "I think it's a waste of effort to test our combat skills. It's a minor province in the make-up of a starship captain.".
DS9 Kira says "I thought starfleet doesn't believe in warships?" to which Sisko replies "Desperate times breed desperate measures, Major."
Voyager is the only one I can't find a reference for, mainly because I detest Voyager and can't watch more than two episodes in week without becoming disoriented.
So there's one person explicitly stating that Starfleet isn't military, but others have said it is, and some Starfleet personnel identify themselves as soldiers. That's hardly definitive enough to rule out any other interpretation.