Since the metre was previously defined by the seconds pendulum, it was entirely defined by the definition of a second and the value of g. From the equations, 1 m = 1 s² × g / π².
While this makes g ≈ π² straightforward, it seems coincidental that the Earth's circumference was close enough to 40 000 km that the redefinition of the metre was a nice power or 10 without too much change to the metre.
[0]: Late 16th century, based on https://en.wikipedia.org/wiki/Second#Fraction_of_solar_day