Hi Pavlo,
Using just Matplotlib GUI, there's not much you can do, since it's rather limited. But I reckon Stéfan's problems arose from the fact that updates made to the window are really slow, so you don't see what the algorithm is doing while you're clicking around. Or at least it didn't do that for me. You could make the logic you execute inside the mouse events available as functions, so people can just pass (mouse) coordinates to your functions and get back coordinates to draw (whichever way they like). That way people can easily integrate your code in whatever GUI they use (an Jupyter Notebook widget would be awesome).
If you want to improve your own GUI code, you could figure out how to get it to draw a bit more often, so you get more feedback. If you click, perhaps leave a marker and then regularly draw the resulting contour. I'd expect that if I click another time, it would at least draw the line it calculated between those two points. In my experience with livewire tools, such as TurtleSeg, you want to add "checkpoints" where you manually specify points where the contour should pass through. Without regular visual feedback, it's hard to judge whether you need one or not.
Still thanks for sharing the code, I hadn't expected such a simple implementation would already work so well
Ivo