I'm not sure about RenPy, but the way I'm doing it is by getting the mouse position when the penetration starts, and then subtracting the start mouse position by current mouse position. This will return the offset. With the offset, I create another variable which I lerp to the real value, giving a smoother effect.
Progressing the bars is just using an absolute value of the offset, divided a bit to get a good speed.
If you use Python/RenPy, I would highly recommend trying out Godot. It's a little confusing for the first week or two, but Godot's GDScript is very similar to Python, and my experience with engine and language has been great overall. It's a pleasure to work with.
In my opinion, GDScript feels like a more "refined" Python. It's like Python with better typing and less confusing naming conventions (variables are defined with var before them, functions are called func instead of def, etc.)