Pretty sure LTO already provides that functionality(I wish Rust had LTO on by default but it's fairly straightforward to flip on).
I am aware that we have to start being more mindful of our dependencies but in commercial this is a luxury that you often don't have.