python: Refactor build of dictionary entries for hosts_to_list
Use Py_BuildValue("{...}",...) for creating each dictionary entry
in hosts list.
Current status:
- Py2: will build and pass tests.
- Py3: will fail to build for missing respective API calls.