I write all my tools myself, so I know exactly what I can do without any actual coding, and I know what additional features are easy to implement. I try to avoid projects which require a lot of additional new code. Then I estimate the hours and multiply by two. The risk of additional work is on me, and I was once off by a factor of around 3, but I try to only accept projects where any newly developed code will either be useful for a long-term contract with the client (which then basically consists of me running a cronjob for money), or where I know that the internal tools I have to develop will be useful for future jobs. Examples of such tools are data converters, data analysis tools, etc.
well that explains a lot. I feel like all my freelancing is making it up as I go along. But I guess I'm more of a generalist than someone you come to when you know wxactly what you want and cost isn't a barrier.
In personal respects, I'm also not sure if I can stomach that kind of pipeline myself where I'm doing more plumbing than problem solving.