Section 131G. Any person who is not a resident of the commonwealth may carry a pistol or revolver in or through the commonwealth for the purpose of taking part in a pistol or revolver competition or attending any meeting or exhibition of any organized group of firearm collectors or for the purpose of hunting; provided, that such person is a resident of the United States and has a permit or license to carry firearms issued under the laws of any state, district or territory thereof which has licensing requirements which prohibit the issuance of permits or licenses to persons who have been convicted of a felony or who have been convicted of the unlawful use, possession or sale of narcotic or harmful drugs; provided, further, that in the case of a person traveling in or through the commonwealth for the purpose of hunting, he has on his person a hunting or sporting license issued by the commonwealth or by the state of his destination. Police officers and other peace officers of any state, territory or jurisdiction within the United States duly authorized to possess firearms by the laws thereof shall, for the purposes of this section, be deemed to have a permit or license to carry firearms as described in this section.