Other things being equal, avoiding lenders with costly penalty rules is one of many ways to reduce your overall borrowing costs.
Incidentally, the industry prefers that mortgage penalties be called “prepayment charges.” That’s because these charges aren’t supposed to penalize a borrower. They’re supposed to compensate your lender for very real costs it incurs when you pay off your mortgage before agreed. (“Costs” refer mostly to lost interest, but lenders also incur underwriting costs, originator compensation, securitization costs, etc.)
The problem is, some lenders impose far more severe prepayment charges than others. Major banks sometimes charge more than twice what a smaller lender would charge for the same term mortgage, even though the bank has lower funding costs. If that’s not “penalizing,” it could have fooled us.