No, this is not possible. Not in Linux and not in any other computer environment. It isn't a limitation of Linux, it's a limitation of physics.
If you run your code on someone else's computer… it's their computer, so they control what runs on it. If they have your code then they can see it run, inspect its memory, make it do different things if they like. They can run your code in a virtual machine for easier debugging. You can try to detect that but whatever you do they can bypass by giving your program the right responses, if they're sufficiently motivated.
Intel SGX works because when I buy a processor with SGX, it isn't really my computer, it remains partially Intel's computer. Intel retains control over the software that runs in the SGX enclave. You ship code encrypted and signed with a key that belongs to Intel; the SGX enclave decrypts and verifies the code with a key that's only accessible by the enclave. The enclave doesn't belong to me, it belongs to Intel, hence if you don't want your code reverse-engineered you need to trust only Intel and not me. I only get an encrypted blob from you and I can't run it elsewhere because I can't decrypt it.
You can use SGX for applications that require I/O. You just have to split your application into two parts: the trusted part that runs in SGX, and the user interface (and storage backend) part that runs outside.
Keep in mind that defenses against reverse engineering are very expensive (in terms of debugging and support costs, and also development time and performance loss). Reverse engineering and modifying a program is expensive; it's usually cheaper to pay you to do the modification than to do it and maintain it in-house.