Create compile_to_bytecode utility function.