TL;DR: I wrote an update to Dan Foreman-Mackey’s template for wrapping C functions in Python.