Each municipality shall, from time to time, fix the boundaries of its districts so as to keep them as nearly equal in proportion to their respective populations as practicable, provided that such changes may not be made in the 270 days before a regular general election for the governing body of the municipality. Districts may not be drawn with the intent to favor or disfavor a candidate for member of the governing body or an incumbent member of the governing body based on the candidate’s or incumbent’s residential address. Any ordinance enacted or adopted by a municipality on or after July 1, 2023, which is in conflict with this section is void.