You are not "forced to give away code" any more than you are forced to use whatever others built and generously made available to you as a starting point or as a building block under the condition you are no less generous.
Feel free to reinvent as many wheels as you like to keep for yourself.
Feel free to reinvent as many wheels as you like to keep for yourself.