I recently learned about a profiling tool: Coz. It aims to give precise profiling results in multithreaded environments and has already packages in Debian and Fedora. Here is the repository: https://github.com/plasma-umass/coz Here is a very informative presentation (CppCon 2020): https://www.youtube.com/watch?v=koTf7u0v41o For example, in this presentation is shown that the effect of -O3 is insignificant in contrast to -O2. I think, this tool might be a good fit for Gentoo.
This project looks very promising. https://repology.org/project/coz-profiler/versions