YAML 1.2 was released 15 years ago and fixed this issue. The problem is not YAML but the libraries people are using to parse it being a decade and a half out of date.
https://youtu.be/aoAp0Z2EREU
Full episode at https://www.dailymotion.com/video/x34uypq