Earlier quoted context omitted.
The powerwalls and powerpacks use a different chemistry from the cars, and are still using the 18650 size going forward. It's trivially easy to change the size of cylindrical batteries. Li-ion batteries are essentially a tape, and the second to last step of production is to roll the tape up and insert it into the battery. Different cells just require different cans and widths of tape.
What about a different chemistry , like Li-Sulfur ? how big of a change the gigafactory will require ?
Realistically, there are probably no changes coming in the next 30 years that will require rebuilding anything significant.