At the extreme end if a user runs something on their computer they can extract the algorithms. The only real way to prevent people from reverse engineering is running all meaningful code on your own hardware.
Python is particularly easy to reverse engineer because you usually ship the source code which is then interpreted. They can read what you wrote literally. If you did a compiled variant this is not as bad.
Java can be reverse engineered as the code is just in time compiled. For example minecraft modding communities would routinely extract the source code repack it with new features.
There are always things you can do to make it harder (using a very optimized binary out of GCC with symbols stripped). But the general rule is, if you don't want them to have it, don't give it to them. Run it personally and give them a remote interface.