There are equivalent convenience functions for compiled Python files and DLLs.
For Python 3.3+ this is a bit more involved, unfortunately:
import importlib.machinery
loader = importlib.machinery.SourceFileLoader("module.name","/path/to/file.py")
foo = loader.load_module()
foo.MyClass()