Is there a library yet that supports using the touchbar in python? Any bindings, or a way to for example call some C
functions that alter things on the touchbar?
Take a look at PyObjC. It provides methods for calling Objective-C functions from Python. It's a great way to play with macOS APIs from Python.
From the website:
The PyObjC project aims to provide a bridge between the Python and Objective-C programming languages.
The website also states the important detail that
The most important usage of this is writing Cocoa GUI applications on Mac OS X in pure Python. See our tutorial for an example of this.
which would indicate that you'd be able to build a touch bar interface using PyObjC.