The 7 with a line thru it is pretty old practice in Europe, where they write “1” with a very long front stroke, making it look almost like an inverted “V”, and therefore easily confused with “7”. The line through the “7” distinguishes it from a long front stroke “1”
The line through a seven goes back centuries. Arabic numerals came in in the later Middle Ages. I have worked with German and Austrian manuscripts from the 1300s and 1400s. The way Arabic numerals were written in those centuries was quite different from the way things settled down. For instance, a four was half of an eight, that is, a loop resting on the baseline with two tails crossing in the middle and descending below—as if you put an 8 on the base line then cut it off about halfway through the lower loop. A five looks a lot like our handwritten fours—a vertical stroke to the right with a wavy, dipping horizontal at the top extending to the left, the way we make fours by an L plus a vertical through the mid-level foot of the L.
A one was often written as a single vertical, often descending below the baseline, perhaps with a slight flip to the left—like a j but taller and without the dot (which is how a single i was often written and the Arabic 1 was in effect, a modification of the Roman lowercase numeral one.
Sevens were very often written with a complete upstroke, from base to peak, then a complete downstroke, like a capital A without the cross-bar. This was no problem as long as one were written as single vertical lines. But when ones came to be written with a flourishing upstroke, if that upstroke got longer and longer, youve got confusion.