We have solved the hardcoding problem in our new install logic: https://github.com/frappe/bench/blob/new-install/bench/config/common_site_config.py#L67
We set default values for various ports, but you are free to change them via common_site_config.json
Even before this, only the socketio port was hardcoded. The rest were configurable.
Frappe/ERPNext’s installer was designed for a novice user to get started quickly. But we neglected the advance user. So, if you can start a single thread about manual install, I can pitch in and then the community can build a readme about manual install?