The bylaws shall also contain equitable provisions permitting the payment of loans before maturity, as follows: The borrower shall be charged with the full amount of his loan, together with all arrearages due thereon or on the shares pledged, or appertaining to the security given, and shall thereupon be allowed, as a credit, the withdrawal value of the shares pledged as security together with an equitable share of the premium, if any, paid in advance, and such other credits as may be returnable on account thereof, and the balance shall be received by the association in full settlement and discharge of such loan. The credits on shares pledged in connection with a loan secured by mortgage on real estate, may at any time, and in whole or in part, be appropriated by any association and applied in reduction of such loan. The withdrawal value of shares pledged as a part of a loan transaction, where such loan is secured by mortgage on real estate, shall be the total amount of the payments on such shares as shown by the books of the association, together with such proportionate share of the earnings as the borrower may be entitled to under the bylaws of the association, less the amounts of previous appropriations and applications on the loan and withdrawals, if any. The association shall not directly or indirectly charge any membership, admission, withdrawal, or any other fee or sum of money for the privilege of becoming, remaining, or ceasing to be a member of the association, except charges upon the making or modification of a loan authorized by section 8-330. Except as authorized by this section and section 8-316, the association shall not charge any member any sum of money by way of fine or penalty for any cause. Payments on real estate loans shall be applied first to the payment of interest on the unpaid balance of the loan and the remainder on the reduction of principal. Any delinquent real estate taxes, both regular and special, which become a prior lien to the association's mortgage, may be paid by the association and added to the unpaid balance of the loan.