Can the equivalent of eval and exec exist in a compiled language? If so, how would they be compiled (roughly speaking)?
Certainly, various Lisp environments have had this capability for decades. A Lisp compiler typically works on a per-function basis, and the compiler and runtime system work hand in hand.
When asked to eval something, the Lisp runtime environment will pass the list (a data structure) to the compiler for compiling. The compiler may generate machine code (or maybe bytecode, depending on the system), and then the function will be callable at the machine level just like every other function in the program.
If Python's exec and eval were compiled?