first and second share some columns but not all.
Stack them row-wise keeping the union of the columns, filling the cells a
frame had no column for with NaN. Order the columns as they first appear,
reading first left to right and then any columns only second has. Renumber
the index from 0.
Input
first =
id name
0 1 a
1 2 b
second =
id score
0 3 9.5
Output
id name score
0 1 a NaN
1 2 b NaN
2 3 NaN 9.5