Section 39. No public school committee or official shall inquire concerning, or require or solicit from an applicant for a position in the public schools any information as to, his religious belief, creed or practice, or his political opinions or affiliations; and no appointment to such a position shall be in any manner affected thereby. Violation of this section shall be punished by a fine of not more than fifty dollars.