(a)
(1) The county court or the county judge thereof in vacation, or the mayor of any city or incorporated town, when authorized to do so by an ordinance duly adopted by the city or town council or other governing body of the municipality, is authorized and empowered to make a contract with any other county, city, or town for the maintenance, safekeeping, and working of inmates committed to county or city jails except inmates awaiting trial.
(2) The county court, county judge, or mayor may make such contract as deemed in the best interests of the county, city, or incorporated town.
(b) For the purpose of making a contract to effectuate the provisions of this section and §§ 12-42-102, 12-42-104, 12-42-105, and 12-42-107, the county court or county judge of any county, and the mayor, with the approval of the city or town council, or other governing body of any municipality, is vested with plenary power.
(c) Any county, city, or town contracting for the safekeeping of inmates under the provisions of this section and §§ 12-42-102, 12-42-104, 12-42-105, and 12-42-107, shall obligate itself to furnish the inmates with good and wholesome food, comfortable clothing, and medicine when sick and shall not require them to work at unreasonable hours or for a longer time during any one (1) day than other laborers doing the same kind of labor are accustomed to do.
(d) A county sheriff, constable, mayor, or other officer to whom a person is committed for imprisonment to serve a sentence imposed for a misdemeanor or petty offense or in default of the payment of fine and costs therefor shall not be responsible for the health, safety, or welfare of the person if the county sheriff, constable, mayor, or other officer shall deliver the person to any county, city, or town other than that of which the former is an officer, pursuant to a contract for the maintenance, safekeeping, and working of inmates authorized by statute.