401k loan, no, for two reasons. (1) As another poster pointed out, there's other loan sources a homeowner can draw upon. (2) As a separate poster pointed out, you face a double-taxation scenario on 401k loans. Plus, because 401k's are intended for retirement, to discourage other use except in emergencies, there is only a 5 year payback period, and if you don't start paying back within 90 days, it will be treated as a distribution, subject to tax then, plus a 10% early distribution penalty if you aren't retirement age.
In other words, we don't even need to debate realistic rate of return on a 401k to see that taking a loan out for this is not a good idea.
Home equity loan, maybe, mainly if you're looking really long term, or place a high value on renewable energy. Here's some calculations behind my conclusion:
NREL says Minnesota averages 4.5 kWh per day per kW of capacity on a year-round basis for an optimally tilted solar panel:
(broken link removed to http://www.nrel.gov/gis/images/eere_pv/national_photovoltaic_2012-01.jpg)
Assuming a $4/Watt cost, minus the 30% tax credit, plus interest at 4.5% on the loan, your 20 year cost would be $4.25 per Watt of capacity (A 6 kW array would cost $25,500 including interest).
At a current price of electricity of $0.12/kWh and 2.7% inflation rate, over 20 years, you'd generate $5.14 of electricity per Watt of capacity (A 6 kW array would generate $30,825).
The average rate of return would be 0.95%. You're better off buying I-bonds.
On the plus side, the panels probably have quite a few years life left in them at that point and are paid for, so now your investment finally starts to pay off meaningfully. By year 30, assuming continued inflation in power prices, your total return is $8.93 per W of capacity. That works out to 3.7% rate of return. So at this point, it's starting to look like a halfway decent investment over a very long time period.
Also, the perceived cost to you is low, because even during the first year before inflation has driven power prices up, your power savings will on average offset 90% of your loan payment.
I should probably factor in the cost of an inverter replacement at some point in the interim, plus reduced power production over time (usually rated at 80% after 25 years, but quality panels seem to trend closer to 90%), but that's detail to flesh out later.