This community sucks

If you put your code up on the forum It get's instantly copied.
And not only that, people demand support on it.

You can simply put a disclaimer in it that people may use the code as is without support.
You are not obliged to give support with such a disclaimer.

I have placed quite some code on the forum/playgorund/github and the number of support questions is 1 per 2 weeks max.
That can be because it is not used, but I hope because the libs are quite mature both in terms of readability, functionality and so.

If you don't show your code here you get pinpointers about what open source is and should be.

Yes they ask, and you can explain in one line why you don't do it ("I have an NDA").
Just write that on the top of the code in the comments.
People will accept that.
Other people also tell when they are under NDA e.g. - Simple angle measurement - #8 by system - Sensors - Arduino Forum -

I disclosed parts of projects (under NDA) in the form of reusable libraries that did not tell anything about the project and were of course technically not the "core" of the project. e.g. - Arduino Playground - HomePage -.
And yes there are zillions of lines of code I do not disclose

Not everything great can be free of charge.

100% true, even most small things need to be paid for.
Not always in money, but still have a price it just depends on the business model .(e.g adds in apps)

And perhaps this is not the right forum for trying to sell hardware.

A forum is primary a place to discuss things and exchange information since the Greek(?) invented them 2 or 3 millis millennia ago
If you want to sell your hardware you need a market.
The forum provides the products and services section for that.
Feel free to promote your product in that section (once, and additional e.g. after updates or fixes, just don't spam)

The exhibition/gallery section is not the "commercial market" section.
It is a place to show what you have accomplished. imho more to inspire people