That shown in TFA is obtained by using the conversion specifier "%a" in the "printf" family of functions from "stdio", i.e. from the standard C library.
The conversion specifier "%A" works in the same way, but uses upper-case letters.
These conversion specifiers were added in the 1999 C standard.
I bet that Python and JavaScript just use "snprintf", like any other language.
In my opinion, whenever floating point numbers are written as strings with the intentions to be read again, one should use "%a" or "%A", because the conversion is exact and much faster than when doing a binary-to-decimal-to-binary conversion.
Even if the written numbers are inspected by humans, the hexadecimal representation is preferable, because when there are many digits it is even easier to use for comparisons (either for equality or for order) than the decimal representation. Any human who inspects a table of such numbers would do only comparisons, without attempting to do mentally more complicated arithmetic operations, which would be too difficult even with decimal numbers with many digits.