Go to /System/Library/PrivateFrameworks/Safari.framework/Versions/A/ and save the file named 'Safari' somewhere safe. If something goes wrong while editing, it's just a matter of copying that back (tested myself).
Do the same for this file /Users/USER/Library/Safari/Configurations.plist.signed.
Open 'Configurations.plist.signed' with any text editor and erase everything in it, making it blank. Save it, and then right-click to 'Get Info,' and tick the 'Locked' box.
Now for the binary I recommend a hex editor, I used the free HexFiend.).
Open the /System/Library/PrivateFrameworks/Safari.framework/Versions/A/Safari with your tool of choice. If you search google/yahoo/bing you'll find several strings, I decided to edit the Bing one because It was the one with the least amount of strings to edit, and as my new search engine I choose DuckDuckgo.
Search for:
http://www.bing.com/search?q={searchTerms}&form=APMCS1
And replace with:
https://duckduckgo.com/?q={searchTerms}
Note that you have to replace the old string with one of the same length, otherwise Safari will crash, and since the new one is shorter, add blank spaces to the end. It's a bit easier if using a hex editor.
Search for:
68 74 74 70 3A 2F 2F 77 77 77 2E 62 69 6E 67 2E 63 6F 6D 2F 73 65 61 72 63 68 3F 71 3D 7B 73 65 61 72 63 68 54 65 72 6D 73 7D 26 66 6F 72 6D 3D 41 50 4D 43 53 31
68 74 74 70 73 3A 2F 2F 64 75 63 6B 64 75 63 6B 67 6F 2E 63 6F 6D 2F 3F 71 3D 7B 73 65 61 72 63 68 54 65 72 6D 73 7D 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
Search for:
68 74 74 70 3A 2F 2F 61 70 69 2E 62 69 6E 67 2E 63 6F 6D 2F 61 73 6A 73 6F 6E 2E 61 73 70 78 3F 71 75 65 72 79 3D 7B 73 65 61 72 63 68 54 65 72 6D 73 7D 26 66 6F 72 6D 3D 41 50 4D 43 53 32
20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
[crarko adds: I haven't tested this one. Be certain you have known good backups of any of these files that you edit, and also be aware that the next time the System or Safari is updated, there may be issues.]

