Section 19. The town clerk may in writing appoint an assistant clerk, who shall be sworn to the faithful performance of his duties; and a record shall be made of the appointment and oath. The assistant town clerk shall, in the absence of the clerk, perform his duties and have the powers and be subject to the requirements and penalties applicable to him, unless a temporary clerk is elected or appointed pursuant to section fourteen. Such duties and powers shall include acting as clerk of the board of registrars of voters, in a town where the town clerk performs this function; provided, that equal representation of the two leading political parties on said board, in accordance with section eighteen of chapter fifty-one, is not affected thereby. In towns having five thousand or more inhabitants an assistant clerk appointed under authority of this section shall not be subject to chapter thirty-one. An assistant clerk appointed under this section shall not be required to be a resident nor a registered voter of the town.