There is a startup option that controls this: `--compile=off` (internally corresponds to `jl_options.compile_enabled`). I don't think there is a function to modify the value at runtime. However, some types of statements are not currently supported by the interpreter, so this is not really feasible yet (see the heuristics in src/toplevel.c:`jl_eval_with_compiler_p` [1]).
Full interpretability (with the exception of `ccall`) is an active goal [2], in order to support static compilation. When that is complete, it may make sense to add a `jl_enable_compiler(bool)` runtime function.