This is very clever.
Last time i ran benchmarks (several years ago), UNIX domain sockets were twice as fast as IP sockets so that's another reason to use them.
However, I could have sworn that I've seen a similar patch in recent years, but either my memories are serving me wrong or I simply can't find it anymore.
Nevertheless, I didn't benchmark whether this is the case, nor was performance the main goal for writing ip2unix. So if performance is a concern, maybe benchmark with your specific workload?