It shall be unlawful for any vessel of over 250 tons net registered tonnage to enter the harbors or passes leading thereto without being piloted and under the direction of a licensed pilot, and all vessels shall be subject to compulsory pilotage except American vessels laden with coast-wise cargo not destined for foreign ports.