People have been saying this here for 10 years, and, respectfully, no, it's not hard to escape this trap. Every project we bid at Matasano had the same terms: a whole-project cost estimate (broken out in units of days or weeks, allocated to milestones), and a clause in the proposal and the SOW that said overages were billed pro-rata additional days. Customers want to see a good-faith estimate of the project cost --- every customer for every service wants that --- but in my experience with
hundreds of clients, not one has ever pushed back on T&M contract structure.
Tell your clients what the project is going to cost, and then work hard not to blow past that estimate. If you go over and it's your fault, eat the overage. If you go over because the customer wasn't ready for 3 days at the calendar start of the project, bill them the overage.
Unless your clients are whackjobs, nobody is ever going to take recourse to the contract terms and the law department. Just engaging the lawyers at all will create costs that swamp the overage dollars. Your customers true recourse is simply never doing business with you again.
If you want to do straight, metered T&M, that's fine. I think it's suboptimal but cromulent. But even then, there's still no reason to ever give your clients an hourly unit of work. Just bill days.