Some points: As Einstein was formulating SR, two facts were already available.
Firstly the negative result of the Michelson-Morley experiment which sought to measure the Earth's motion through the aether (via differential speeds of light causing interference). The Lorentz transformations in which the (apparent) speed of light in vacuum is a invariant were formulated to explain this negative result in terms of shrinking distances and slowing of clocks due to motion through the aether. (These transformations form a group of rotations and frame transformations on velocities, the Lorentz group).
The second fact was Maxwell's equations which describe the propagation of light and other electromagnetic radiation and the fact that these are invariant under the Lorentz transformations.
Einstein didn't invent the Lorentz transformations but rather re-interpreted them as relativity transformations rather than physical effects. He thereby showed other implications such as energy-mass equivalence. He eliminated the need to assume an aether as a medium for electromagnetic propagation.
Now a third mathematical fact also comes into play. If you consider all the possible groups of velocity transformations which include rotations, there are three possibilities.
- Firstly there is a larger rotation group for which increasing velocities would be periodic. Go fast enough and you're back to zero velocity. This doesn't fit basic facts nor does it fit certain consistency requirements (you'd be able to turn your time axis backward).
- The other simple group is a Lorentz group with some absolute maximum velocity which is the same for all observers.
- The third is the classic Galilean velocity transformations where you simply add velocities. It is a singular boundary case between the first two applying at various scales, (the flat line between classes of ellipses and hyperbolas.)
This third is what we thought until Einstein's explanation of the the Michelson-Morley experiment and the subsequent experiments verifying both the second group type and that this maximum velocity is the speed of light in vacuum.
Finally note that now with Einstein's unification of space and time, we should use common units for both distances and durations. Imagine we measured height in fathoms and lateral distances in furlongs. We'd need to explain oblique rotations by introducing a unit conversion constant with units of fathoms per furlong. This is the case with space-time and we need a unit conversion factor in units of meters per second. That unit conversion factor is c and in common units the "speed of light in vacuum" is 1. (as in 1 light-second per second).
Now we assign a value to c instead of treating it as a measured physical constant. This is a matter of using the standard second to define the standard meter by virtue of light traveling c standard meters in a second. It becomes immaterial whether the speed of light varies or not as it is now by definition fixed. We instead treat any variation in terms of variation of space-time geometry which is part and parcel with Einstein's GR and its explanation of gravity.