Is there a way to manually clear those buffers without calling backward?

Yes you just need to make sure you don’t have any reference to this graph before looping.
You can either do a bunch of del statements. Or use a function so that you are sure that everything that was still in scope is deleted before looping.