What language are you writing your code in? You can just use the raw transaction api without tinkering with the source code?
I am using Python and yes, indeed, I can use raw transactions but the advantage of the sendtoaddress function is it automatically takes care of combining inputs, handling fees, and setting up outputs for change. That is tedious work I might get wrong if I try re-implement. I am currently making progress with hacking Bitcoin not to send the transaction. It involves setting connect=127.0.0.1 in the config, killing the daemon after the sendtoaddress and then removing the database entry. Bitcoin can't send the transaction like this but still returns a TX ID. It's kind of worse than just manually implementing sendtoaddress so I probably won't be using this.
Do you know of any good libraries that might help replicate sendtoaddress?