The mars probe unit problem was mismatched between different software programs. One was telemetry reported by the spacecraft to the ground, the other was software on the ground that used this telemetry to perform calculations that reported the results with the incorrect units.
Maybe the answer is that strong typing should somehow continue outside of the individual programs and be embedded in file formats as well?
which does all sorts of checking, allows arithmetic with proper accounting for units and so on. But yes, the basic notion is wrapping things in structs which can't be simply assigned to each other.
typedef struct { float value; } meter;
typedef struct { float value; } feet;
Using strong typing, you can avoid passing values in wrong units.