Use `sol::environment` for script sandboxing
developsol::environment is a specialized sol::table used to provide a specific scope for local variables during script execution. It allows you to encapsulate variables so they are not stored in the global environment.
Because sol::environment inherits from sol::table, it supports all standard table operations. You can also manipulate its metatable (e.g., using sol::metatable_key) to set an __index that points to a fallback table (like the global table), allowing the environment to read from globals while keeping its own writes local.
Note on Copying: Copying a sol::environment object does not perform a deep copy of the Lua table; it creates a new reference to the same Lua object.