Section 64. The commander-in-chief may exclude traffic from public ways and highways during target practice or maneuvers of any organization or unit of the armed forces of the commonwealth or the United States or of any state thereof if public convenience or safety so requires.