Idk what Pillow is or how it exports, but you could use GDScript to save it as an image with a 32 bit color depth. Then it would run slow just once.
var image := Image.create(width, height, false, Image.FORMAT_RGBF)
for i in range(0, stars_x.size()):
var color := Color(stars_x[i], stars_y[i], stars_z[i])
var pixel_coord: Vector2i = get_pixel_coord(i) # however you want
image.set_pixelv(pixel_coord, color)
image.save_exr("user://my_file.exr") # or save_png, I think both support f32 color components
That's exactly how it went at my last workplace. Management wasn't satisfied with employees meeting the new goals and started stressing it so much every team lead was faking metrics just to prevent further harassment about it. Ended up having teams spending a lot of time fabricated metrics instead of working to prevent further bother from the higher ups. Soon everyone was reporting lots of deployment accomplishments during a period in which we weren't allowed to deploy changes, and there was a quiet consensus among everyone that you had to fabricate data.
The higher ups can never fail, only be failed, and so everyone better get good at lying, or else they're getting fired for failing to meet goals.