(1)(a) Any other provision of law to the contrary notwithstanding, no municipality may refuse services or discontinue utility, water, or sewer services to the owner of any rental unit or to a tenant or prospective tenant of such rental unit for nonpayment of service charges incurred by a former occupant of the rental unit; any such unpaid service charges incurred by a former occupant will not be the basis for any lien against the rental property or legal action against the present tenant or owner to recover such charges except to the extent that the present tenant or owner has benefited directly from the service provided to the former occupant.
(b) This section applies only if the former occupant of the rental unit contracted for such services with the municipality or if the municipality provided services with knowledge of the former occupant’s name and the period the occupant was provided the services.
(2) The provisions of this section may not be waived through any contractual arrangement between a municipality and a landlord whereby the landlord agrees to be responsible for a tenant’s or future tenant’s payment of service charges.
(3) Any other provision of law to the contrary notwithstanding, any municipality may adopt an ordinance authorizing the municipality to withdraw and expend any security deposit collected by the municipality from any occupant or tenant for the provision of utility, water, or sewer services for the nonpayment of service charges by the occupant or tenant.
(4) In any case where a tenant subject to part II of chapter 83 does not make payment for service charges to a municipality for the provision of utility, water, or sewer services, the landlord may thereupon commence eviction proceedings. Nothing in this section shall be construed to prohibit a municipality from discontinuing service to a tenant who is in arrears 30 days or more, or as required by bond covenant.