You can run the dehash script on your yaml and tell it to leave c-preprocessor (cpp) directives and then run the dehashed file through the c preprocessor. That lets you use all cpp directives including #if 0 ... #endif and/or /* ... */ to do block comments.
dehash can be downloaded from github with this command:
git clone [email protected]:maartenwrs/dehash
After the above command before changing directory, it can be temporarily added to your path with:
export PATH="`pwd`/dehash:$PATH"
After running dehash on your file and piping the output through cpp and saving the output of that in a new file, it can be used in place of the original file. The new file will not have the block comments as they will be removed by cpp. For example:
dehash -c -o - my.yaml | cpp -P > my2.yaml myToolThatReadsYaml my2.yaml
For those that use make, there is a template Makefile and example here: https://github.com/maartenwrs/espmake. Although it is tailored to esphome yaml files, it is relevant to most yaml projects.