All depends on job market.
Almost a must for Physics professor. ~ 20% PhD graduates become professors (not right away).
CS not a must. 40% goes to acedemia.
https://ww2.aip.org/statistics/faculty-job-market-in-physics-and-astronomy-departments
https://ww2.aip.org/statistics/whos-hiring-physics-phds
https://ncses.nsf.gov/pubs/nsf24300/data-tables
USA physics and CS phd graduates around 2-3k each year. Some could become professor outside of USA but there are graduates from overseas competing for professor positions in USA.
Biology professors typically go through 2-term postdoc.
加注:樓下說 research type university CS tenure track professor positions still require postdoc.