I think that looking at long term historical data has value here. I created a spreadsheet which took the S&P returns for Years from 1900-2018, and calculated the 15 yr returns starting with 1919 to have the last 100 rolling 15-yr returns. Then I sorted to see how these numbers were distributed.
The top 50 results were over 9.88%, with the highest being 19.10%
The next 25 results ranged 6.55% to 9.78%
The next 15 results ranged 4.63% to 6.54%
The next 5 results ranged 4.13% to 4.44%
The bottom 5, the worst results were .73%, 1.93%, 2.62%, 2.74%, 3.51%
My conclusion? Those who take the 30 and invest the difference are very likely (95%+) to achieve a successful outcome, accumulating a greater balance than the mortgage still owed, after the 15 years have passed.
I'll pause here and say that I acknowledge that "past performance is no guarantee of future results", and "your results may vary." But this is the best we have. My conclusion would be very different if the S&P returns averaged 4-5%, of course.
And, there are those who would say that a 15 year return isn't quite the same as DCA (dollar cost averaging) by making the purchases each month/year over that same period. To this, I agree. I suspect, however that the results for that quite larger effort would only differ very slightly at the margin, and given the nature of DCA, i.e. 'buy more at lower prices, less at higher' they would actually improve.
For those pursuing such a decision, I'd suggest getting comfortable with a spreadsheet and analyzing the data to your own satisfaction. If OP is wondering why I used 15 when the comparison is 15 vs 30, simple. It's 15 years hence. You are looking to see how successful your plan was. You look at 2 statements, the mortgage balance and the brokerage statement. If, at this point, the brokerage account is higher, you are happy. If it's close or slightly lower, not so much. If the latter were true, there's still the next 15 years to make up for it, and history shows that after a bad decade we are more likely to have a better one, so for the very disciplined, staying the course with your decision is best.
From my own experience, I wrote an article, "Retired, with Mortgage" where I offer that after 15 years of following my own advice "the 401(k) had $349K extra vs our $265K mortgage" and noted that this time period, the 15 years ending in 2012, contained 2 market crashes. I'll also quote, "Two years have since passed, and the market in 2013 and 14 was very rewarding. A gain of over 50%. We ended 2014 with the mortgage at $233K and the calculated 401(k) extra funds at $453K."
In our case, the interest is deductible, so our 3.5% mortgage is really costing 2.73%, for whatever that's worth. I understand yours is not deductible, but if the numbers were so close for a decision I'd stay clear. You can see that the 5th worst rolling period was 3.51% vs 2.74% for the 4th worst. Either way, a 96%/95% chance of success.
One last point before I wrap up. The numbers here assume 100% discipline. For 180 months, making the deposits of the difference between payments. If you or partner have any risk that the growing pile of cash is a temptation, then paying off the mortgage at a faster pace is best. Of course, ten years later (you'd send even more money that the amount due, right?), you'll have a paid off house, no mortgage and a large bump in free cash. Then what? Will you suddenly get responsible? At that point, if you were to lose your job, there are still bills to pay, including property tax. Whether I've done everything perfectly (I haven't) or not, I've always slept better knowing I had a buffer of money, whether it be the retirement accounts or a pre-arranged HELOC. That's worth more than the fully paid house but no liquidity in a tough time. We practiced that right until the layoffs came in 2012 and my wife and I were fired. Which led to our decision to retire early.