Could you give an example, why a program must stick to fixed values and cannot use the defined masks, like S_IFDIR, and macros, like S_ISDIR()?Look at the python code, and git is the examples. There are applications out there that assume the values are consistent, and ignore the macros.
Since this assumption is wrong, then it looks like a bug in python, which should be reported to the python developers or fixed and committed to the main source. Same with the other program you mention.
The bug (if it is a bug) doesn't show up because other unixoids use pretty the same values, but still it is a bug.
Pozdrawiam KMK