Physics engine hacking for looped worlds

Godot Version

4.2.2

Question

I’m trying to make 2D physics for game where world is looped on screen sides. If part of any body (static, rigid, character) moves over screen edge - it should appear on the opposite edge and affects physics of bodies nearby as expected.
Visual wrapping is easy but physics is a big problem - I couldn’t find any way to make 2 bodies to act as one. Just duplicating collision shapes didn’t work - it changes body reaction to rotation. I also tried to copy back and forth linear_velocity and angular_velocity in _integrate_forces callback - it somehow works, but bodies jitters violently.
Can I make such behavior without modifying physics engine?

For context: some objects in game expected to be big, and might self-collide. Also in some scenes many objects may fill full screen width and should stay stable.

After some research of source code I come to conclusion it is impossible without engine modification.
And most appropriate way to modify is introducing new kind of joint (like pin joint but with individual pivots for bodies A and B).