Its is possible by using mach_inject. Take a look at Death to .DS_Store
I found that overriding HFSPlusPropertyStore::FlushChanges() with a
function that simply did nothing, successfully prevented the creation
of .DS_Store files on both Snow Leopard and Lion.
DeathToDSStore source code
NOTE: On 10.11 you can not inject code into system apps.