If you look it seems like portions of the STM HALs are autogenerated in some way, even if it's by stitching pieces of code together. If not there is a lot that could be automated, and my general complaint is there is a lot of manual work that is unskilled and no fun to do to get an MCU target up and running.
The Rust project is a step in the right direction.
svd2rust [1] is an project that generates a (very low level) Rust API for a specific micro from this file.
Generally the file generated from this is known as the header files (as it is just C headers to access the registers directly) and the HAL is an abstraction layer on top, and is actually written manually by the microcontroller designer as it contains higher level functions (e.g. a function to calculate the clock settings to get a specific UART baudrate).
The STDLib is often supplied by the compiler vendor instead, or is an open source project like picolibc [2]
[1] https://github.com/rust-embedded/svd2rust
[2] https://github.com/picolibc/picolibc