Describe the mechanics of the built-in compile() function. How to convert a dynamically generated string of Python code into a code object, execute it safely in an isolated context using exec/eval, and prevent remote code execution vulnerabilities (RCE)?