Add `compile_static` and `compile_static_lazy` utility functions.