Add locals option to runPython and runPythonAsync. 
### Checklists

- [x] Add a [CHANGELOG](https://github.com/pyodide/pyodide/blob/main/docs/project/changelog.md) entry
- [x] Add / update tests
- [x] Add new / update outdated documentation

From 312ba1b0975c8dad8dac3f43560d6f8b1ccf59e3 Mon Sep 17 00:00:00 2001
From: Hood Chatham <roberthoodchatham@gmail.com>
Date: Sat, 11 Jun 2022 12:19:42 -0700
Subject: [PATCH 2/3] ENH: Fix pointer size determination for cross build

Using `sys` to ask about the build Python is hostile to cross
building because it is very hard to replace the sys module with one
that gives info about the target system. On the other hand, the
sysconfig data can be replaced by setting _PYTHON_SYSCONFIGDATA_NAME.
So instead of using `sys.maxsize` to determine pointer size, use
`sysconfig.get_config_var("SIZEOF_VOID_P")`
---
 numpy/linalg/setup.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/numpy/linalg/setup.py b/numpy/linalg/setup.py
index dc62dff8f..4643d8a30 100644
--- a/numpy/linalg/setup.py
+++ b/numpy/linalg/setup.py
@@ -1,5 +1,6 @@
 import os
 import sys
+import sysconfig
 
 def configuration(parent_package='', top_path=None):
     from numpy.distutils.misc_util import Configuration
@@ -38,7 +39,7 @@ def configuration(parent_package='', top_path=None):
         class numpy_linalg_lapack_lite(system_info):
             def calc_info(self):
                 info = {'language': 'c'}
-                if sys.maxsize > 2**32:
+                if sysconfig.get_config_var("SIZEOF_VOID_P") > 4:
                     # Build lapack-lite in 64-bit integer mode.
                     # The suffix is arbitrary (lapack_lite symbols follow it),
                     # but use the "64_" convention here.
-- 
2.25.1


From 312ba1b0975c8dad8dac3f43560d6f8b1ccf59e3 Mon Sep 17 00:00:00 2001
From: Hood Chatham <roberthoodchatham@gmail.com>
Date: Sat, 11 Jun 2022 12:19:42 -0700
Subject: [PATCH 2/3] ENH: Fix pointer size determination for cross build

Using `sys` to ask about the build Python is hostile to cross
building because it is very hard to replace the sys module with one
that gives info about the target system. On the other hand, the
sysconfig data can be replaced by setting _PYTHON_SYSCONFIGDATA_NAME.
So instead of using `sys.maxsize` to determine pointer size, use
`sysconfig.get_config_var("SIZEOF_VOID_P")`
---
 numpy/linalg/setup.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/numpy/linalg/setup.py b/numpy/linalg/setup.py
index dc62dff8f..4643d8a30 100644
--- a/numpy/linalg/setup.py
+++ b/numpy/linalg/setup.py
@@ -1,5 +1,6 @@
 import os
 import sys
+import sysconfig
 
 def configuration(parent_package='', top_path=None):
     from numpy.distutils.misc_util import Configuration
@@ -38,7 +39,7 @@ def configuration(parent_package='', top_path=None):
         class numpy_linalg_lapack_lite(system_info):
             def calc_info(self):
                 info = {'language': 'c'}
-                if sys.maxsize > 2**32:
+                if sysconfig.get_config_var("SIZEOF_VOID_P") > 4:
                     # Build lapack-lite in 64-bit integer mode.
                     # The suffix is arbitrary (lapack_lite symbols follow it),
                     # but use the "64_" convention here.
-- 
2.25.1

