Is total distance walked specific to a single Pokémon, or to a species of Pokémon?
The total distance walked for a Pokemon is related to that specific Pokemon.
That is, if you were to switch Squirtle A with 10km walked for Squirtle B with 5km walked, Squirtle B's total distance walked would appear as 5km walked, rather than 15km walked. This is how it has always worked.
Here are some images to prove it: