I will agree with @owen.campbell here. Licensing is a simple and easy way to stop them from stealing. Plus, your backend will always be safe.
But just in case you want to do something really crazy, you can try
Step 1: Do all your Anvil work on a hidden app
Step 2: Maintain a published version of the app. This will have all forms and modules as your hidden app. But keep the code for all forms and modules blank for now.
Step 3: Choose one of the trillions of methods to encode code for all forms and modules.
Step 4: Now you fill the blank forms in your hidden app. First, decode the code for that respective form or module. And then, use the exec method on that decoded string.
This method will make your development more difficult and can have effects on your performance too… Even I find this absurd. But I don’t think there is any other way to hide your client code.
Actually I realized - What am I doing? If the client-side can decode your code, anyone can do it too. This method will just stop the code from being visible too easily