[Feature] Support external package imports
Describe the bug We may want to eventually include certain frozen packages in some firmwares. For example, asyncio may be useful for working with rfcomm sockets.
However, there are certain issues with pb_builtin_import that prevent this from working. First, it explicitly does not handle the MP_IMPORT_STAT_DIR return code, which indicates that the imported name is a directory in the frozen content.
Second, it appends ".py" to the imported name. This seems to work okay for names that are individual python files. But, it does not work for package names, like asyncio. The package is represented in the mp_frozen_names list as "asyncio/__init__.py\0". Appending ".py" to the asyncio name causes a mismatch with the path separator.
And yet, if we didn't add the .py suffix, then we wouldn't be able to match top-level files like _builtin_port_view.py.
One thing I do notice: the comment above this function says, "// IMPORTANT: this needs to be kept in sync with mp_builtin___import___default().", and, looking at mp_builtin__import_default(), it does appear that that function has moved on significantly from the last time we took a snapshot of it.
Not sure what to do about this right now -- probably just get by without asyncio! -- but it might be worth looking at at some point.