Apart from database languages like SQL, I think learning 'matching' languages would actually be the way to go.Python is a great language for when performance doens't matter half as much as development velocity "OR" if you can move performant concerns down. I think in 2025 the down language for pure CPU targets should probably be Rust rather than C++ for most users. It's almost as fast in many cases, much easier to learn, and depending on experience, often much safer in terms of sometimes exploitable bugs. C++ though has one area where Rust doens't hold a candle to it, and that is GPU usage. C++ with CUDA or SYCL basicly are unmatched for GPU based paralelisms based performance.
Java is a whole different matching place. While Java as high level language may be a bit outdated now for most purposes, The JVM is not, and other JVM languages are basicly turning Java into the C++/Rust of the JVM. So just like its good to master C++ or Rust together with Python, it is good to master Java with Kotlin or Clojure.
A third mix that I think can be very interesting for some of is the BEAM mix. BEAM stands to Erlang as Java stands to JVM basicly, but even more than Java, it's kind of an aged language. Elixir as high level language is amazing.
So my view would basicly be, if you want to learn a new language: either pick one that completes a stack of which you already know a language, so know Python? Learn Rust, Know Java, learn Clojure, etc, and if there is no language that fits the bill, choos the stack first, rather than the language, and then go top down.
I agree with you completely