I would have thought Primes.
1) IS availability
2) f-stop advantage
3) the 17-40 is not parfocal as far as I recall - so you would need to refocus if zooming
4) normally lighter in weight
3) No tempation to zoom :-)
Versus - can't zoom...
Can't recall if the 17-40 is weather sealed - could be an advantage if required
I have the 17-40 myself in addition to the 40mm pancake.
If you choose the 17-40 both 1 and 2 above is right.
3 is wrong. Once focused, you can zoom as much as you like and it's still sharp. And sharp it is!
4 is right. But the 17-40 isn't heavy. The weight is IMO not an issue with that zoom
The 17-40 is absolutely weather sealed as long as you use a filter. One of the lightest and cheapest weather sealed lenses there is.
IS with a tripod is in fact negative. The rule of thumb is to switch it off when you use a tripod... :-)
About the DOF as mentioned by others. A wide angle (17mm) will be sharp from 1m to infinite on f4 - more or less. If you want the good video DOF look, you must at least take your video on 40mm.
The pancake on the 5dmk3 is a very good match for video, indeed!