The issue went away after I disabled python compileall: https://github.com/Zaczero/osm-relatify/commit/01f76bd17a90874c7e11eb7b4f60f1d3cf54ccbd. Looks like I broke Python somehow :-) So much time spent on debugging this.