The mayor shall have power to remit fines and forfeitures, and to grant reprieves and pardons for offenses arising under the ordinances of the city; but this section shall not be so construed as to authorize the mayor to remit any costs which may have accrued to any officer of said city by reason of any prosecution under the laws or ordinances of such city.