This version has a number of refinements compared to what was shown in the previous video - visually I swapped to a new method for creating trails and improved the recording quality, and on the simulation side I refactored the code to make use of Godot's RigidBody system for detecting/handling collisions, and moved the force calculations into the _physics_process loop rather than the idle _process loop*.
As a bonus I also set up automatic removal of bodies that go too far away from the system's centre of mass to both simplify calculations and improve the view from the CM frame. The limits for automatic removal are a bit harsh at the moment (mostly for testing), I'll probably relax them next time. Something else to consider is setting up some kind of dynamic zoom level to try and keep everything on screen.
*This was the source of the "randomness" mentioned in the previous video, since the time intervals in the idle loop fluctuate with your cpu load.