The proper solution is licensing. MySQL seems to do okay letting everyone see their source code and people paying them when they need to use the non-free license. Remember - even compiled C code can be decompiled. It's all a matter of how much people care to figure out what you're doing. Frankly, most people couldn't care less about how your code works so long as it
work. The people who do care generally tell you how to fix it. What's wrong with that?