var maxIndex = (4*3*4)
for indexStart in range(19000, 19800, 100):
for index in range (0, maxIndex):
RenderingServer.canvas_item_set_transform(VisualsCore.Sprites.ci_rid[indexStart+index], Transform2D().translated(Vector2(-9999, -9999)))
You're creating a new Vector2 and Transform2D, with the same x and y, 384 times in this loop. I doubt it will hurt anything to use the same Transform2D for every sprite if you're replacing them later. Or, just use their transform property and don't ever create new ones. Is it necessary to move all the sprites off screen and back on when a piece moves? I'm not sure what you're doing there.
Edit: In fact, since Transform2D and Vector2 are built-in types, they should be passed by value, so it definitely won't hurt to use the same one, and you'll save three function calls per loop.
Also, I believe gdscript compiles to bytecode, so you could add a lot more comments without hurting anything.