The law existing at the time of a contract for the loan or forbearance of money, goods, or services, or things in action shall determine whether the interest charged on the loan or forbearance exceeded the maximum statutory interest rate, and the penalty for exceeding the maximum statutory interest rate in effect at the time of the transaction shall be applied notwithstanding a subsequent repeal or modification of the maximum statutory interest rate. This section applies to all actions to enforce a contract for the loan or forbearance of money, goods, or things in action that have not been reduced to final judgment on May 29, 1985, and applies to all contracts governed by this chapter and chapters 47, 48, 50, 51A, 52, 53, and 56, except sections 334.16 to 334.18.