Add loadDynlib to micropip._compat (split off from #2591). More work split off of #2591 because #2591 mysteriously fails *all* the github actions tests, even though #2591 currently only changes micropip and not all tests load micropip.
from pyodide._core import IN_BROWSER

if IN_BROWSER:
    from ._compat_in_pyodide import (
        BUILTIN_PACKAGES,
        fetch_bytes,
        fetch_string,
        loadedPackages,
        pyodide_js,
    )
else:
    from ._compat_not_in_pyodide import (
        BUILTIN_PACKAGES,
        fetch_bytes,
        fetch_string,
        loadedPackages,
        pyodide_js,
    )

__all__ = [
    "fetch_bytes",
    "fetch_string",
    "BUILTIN_PACKAGES",
    "loadedPackages",
    "pyodide_js",
]

from pyodide._core import IN_BROWSER

if IN_BROWSER:
    from ._compat_in_pyodide import (
        BUILTIN_PACKAGES,
        fetch_bytes,
        fetch_string,
        loadDynlib,
        loadedPackages,
        pyodide_js,
    )
else:
    from ._compat_not_in_pyodide import (
        BUILTIN_PACKAGES,
        fetch_bytes,
        fetch_string,
        loadDynlib,
        loadedPackages,
        pyodide_js,
    )

__all__ = [
    "fetch_bytes",
    "fetch_string",
    "BUILTIN_PACKAGES",
    "loadedPackages",
    "loadDynlib",
    "pyodide_js",
]
