You really can't know how long it'll take, since most people will overpromise and underdeliver. At least if its a fixed cost, you don't lose any extra money for someone else being lazy
Instead, I'd recommend either fixed price for small, bite sized tasks, or (as per my current contract) a weekly rate until completion. I work on rapid turn-around, so the client almost always knows exactly where the project's at and how it fits with their requirements. Of course a precondition of this is a decent level of trust on both sides, and a client who's not a pain.
1) The client over-pays due to developer over-bidding. (In relation to the time it took him to complete the project.)
2) The developer over-works due to under-bidding.
Neither is particularly advantageous for the client, as a developer will not be as responsive to a client's needs if he or she is working towards a minimum feature set.
A developer can make a reasonable estimate based on clear goals. If requirements change (as they inevitably do) the developer will be compensated accordingly. Similarly, if the project is finished in less time than expected, the client will reap the benefits.