Merge pull request #3760 from rw/python-remove-ctypes-dependency

Python: remove ctypes dependency in runtime library.