I think, I saw similar questions on this stack exchange before, so you may also want to have a look at what others wrote about this topic. Let me answer this from the perspective of research software engineering and also based on my opinion (the answer to your question is, of course, subjective).
You can see research software engineering as a general term for software engineering in an academic environment. This comes with several constraints: You have small and rapidly changing development teams (often consisting only of a single person with limited software development experience doing a PhD thesis), software projects with unclear duration and scope, a multitude of rather special hardware architectures and software environments that may change over the duration of a project, specific (software development) expertise in a research group, and so on.
Such an environment narrows the number of reasonable options for the choice of programming languages. This may even be research-group or developer specific. From the perspective of hardware architectures and software environments, developers have more choices if they know beforehand that the program only has to run on their workstation or a similar computer.
If the program has to run on multiple compute nodes of a high-performance computing machine there are - in connection to the available software environments - mostly 3 viable options for programming languages: Fortran, C, and C++. All of these languages have specific advantages and disadvantages. C++, for example, comes with a large standard library of data structures and algorithms and also with many language features. This makes for a very powerful tool, but also a tool that demands a lot of expertise from the developer to not mess up things. Fortran, on the other hand, is much simpler to learn and comes with a language structure that is simple to understand for developers and also for compilers. A student with limited programming experience working on a thesis has it easier to write good and fast code in Fortran. The choice here would thus depend a little bit on the skills of the developer and the skills that are available in the research group. Of course, the demands from the project also play a role here.
When it comes to the development of toys, i.e., small test programs or prototypes, the automatization of workflows, or the preprocessing, postprocessing, and plotting of data, Python is a much more viable option, though the choice of programming language here also depends on the skills of the programmer. These applications are more likely to only run on a well-defined set of workstations and software-environments and the projects are typically smaller and have a more limited lifetime. Here, Python code may be more compact in comparison to many other languages and there are also many software libraries available that make the developer much more productive in such a setting. These many available software libraries, however, are both, an advantage and also a disadvantage. I saw several small, but very nice software projects die, because the associated "Python dependency hell" was not resolvable anymore after some time on another computer and for a different developer. Of course, there are measures to take care of this (for example docker containers) and also of problems arising from the dynamic interpretation of Python programs that may give the inexperienced programmer a syntax error after the program was running for hours or days. But a beginner programmer starts to address such problems only after they appear and then it may already be a little late.
Of course, there are also many more programming languages that may be good choices, depending on the respective context. I think the most important part is that the developer makes a well-founded choice what language to use, based on all relevant circumstances. In my answer I wanted to sketch a little bit some of the special circumstances that may play a role here.