How to hide add-on source code
While that seems possible it is not at all recommended. Not only would that go against Blender GPL license, it goes against it's open source philosophy.
The way I see it you are totally encouraged to sell your addon, everyone is entitled to make a living from its hard work. If you invest time and resources into creating something you should be able sell it, so that it becomes both rewarding and sustaining, allowing you to invest back more time and efforts to improve it.
If you sell Blender addons to users however, you are always essentially paying for a &quot;download service&quot; or &quot;access&quot; to relevant files technically, not actually buying the code itself.
The Blender license states that any script that interacts with its code and hence with it's API must be published with the same or a compatible license. Externally linked code or libraries (like say an external render engine, or closed source third party resources) may use any different licenses.
Quoting the official license

Sharing or selling Blender add-ons (Python scripts) Blender’s Python
API is an integral part of Blender, used to define the UI or develop
tools for example. The GNU GPL license therefore requires that such
scripts (if published) are being shared under a GPL GPL compatible
license. You are free to sell such scripts, but the sales then is
restricted to the download service itself. Your customers will receive
the script under the same license, with the same free conditions as
everyone has for Blender. Sharing Blender or its scripts is always OK
and not piracy.

The philosophy is always to share our findings and globally improve our collective knowledge, there is more to gain globally for the community as a whole from sharing, than from restricting the information flow for personal gains.
To answer you question directly, there are a few solutions around to obfuscate or encrypt Python code (that may or may not work well within Blender), but as an interpreted language I fear this something fundamentally hard to achieve and inherently easily reversible for anyone determined to actually do it.