I mention the above because I am interested in this answer myself and would be keen to see whether someone has made a calculation that looks at the opportunity cost between the two choices that takes into account some the variables mentioned.
I went through and did the calculations a few years ago. As you suggest, there are blue million different variables/assumptions you can look at and I looked at pretty much all of them, then went back and looked at them again. However, it doesn't much what matter what assumptions you use. Not paying down the mortgage pretty much wallops paying off the mortgage from a financial perspective regardless of what assumptions/variables you use.
I didn't maintain a copy of my spreadsheet, but it is reasonable easy to do yourself.
Unequivocally, one's savings rate has a much larger impact on the journey to financial independence than one's return on investments. If one assumes that net worth accumulation towards financial independence takes places over an average of 10 years, why would someone borrow money for 15 or 30 years in the hopes of generating additional yet arguably arbitrary (for the purposes of retirement financial independence) returns over the same horizon?
Good question. Here's why: Savings rate is the path to FIRE. Staying FIREd requires investment returns. Paying down the mortgage results in a
future savings. A future savings is surely a good thing, but it usually isn't as good as a current savings. If you are paying down the mortgage, you are
not saving now. You are saving later. Therefore, your savings rate right now is lower then if you were investing the money.
Let's say you pay off your mortgage 15 years early. The money in your house will earn virtually nothing for you. But if you had been saving and investing the whole time, you should have a pretty good stockpile that is growing a decent amount of money. Even though your expenses go down at year 15 and therefore have more money to invest, you'll never catch up to the guy who was investing the whole time.
That's the main reason. Here's another reason: Inflation. In year 2000, a $1500 mortgage had the same real dollar value as a $2000 mortgage today. In other words, your future savings gets smaller every year. You are using full value dollars today in order to save inflation eroded dollars in the future. If wages keep up with inflation, the mortgage as a percentage of your income goes down, so you can increase your savings rate by doing nothing. That's true in both scenarios. But you can see that it becomes easier over time (again if wages keep up) to make the mortgage payment. Hence the benefit of paying off the mortgage becomes less over time.