Based on bitter experience, and after consulting with an IDA-Pro expert the best solution is to move a key part of the code into a DLL/SharedObject, then fetch it from a server and load at runtime.
Sensitive data must be encoded as it's very easy to do something like this:
$ strings libsecretlib.so | grep My
My_S3cr3t_P@$$W0rD