Personally I would go with the longest term possible but start overpaying from day one whenever / whatever is possible.
Leads to smaller mandatory monthly repayments and gives more fexibility in regards to cash flow.
On taking the advantage of investments - thats imho only valid for investing...