What is the fastest way to duplicate inserts of an identity column to another table?
Try

WITH cte AS ( INSERT INTO data(name) 
              VALUES ('some value'), ('one more value')
              RETURNING id )
INSERT INTO ids 
SELECT id
FROM cte;


fiddle