I added a function to create variable width buffers in pygeoops: pygeoops.buffer_by_m.
It is based on the function I wrote above, but made a bit more robust, and it uses the Z or M values present in a shapely LineString for the distances.
I also has support for multilines and very experimental support for polygons.
It is a very first version, so most likely there will be bugs... but feedback is very welcome.