Section 4. A city or town may make contracts for the exercise of its corporate powers, on such terms and conditions as are authorized by the town meeting in a town, the town council in a town without a town meeting, the city council in a city with the approval of the mayor or the city council in a Plan D or Plan E city with the approval of the manager, or as otherwise authorized in accordance with a duly adopted charter. A city or town may not contract for any purpose, on any terms, or under any conditions inconsistent with any applicable provision of any general or special law.