Does your employment contract (or the closest thing you have if you work in the US) specify 40 hours a week? Mine doesn't. It says I need to be available during "core hours" which amount to about 17.5 hours a week. It also takes about half a page to basically say "you have to get your assigned work done on time or you may face disciplinary action." If you're available during core hours only, and your stuff gets done, you've fulfilled your end of the bargain.
I've worked placed where you have to have your ass in a seat 42.5 hours a week minus lunch. You can't work there and have another FT job, it's not tenable even for a week or two. But I know a lot of people who either have a FT job and a long-term/large contract position, or two FT W2 jobs simultaneously for months or longer.
Your overly broad "[nearly] universal case" doesn't match the vast majority of the job descriptions I've seen when I was job searching earlier this year. Software development jobs are increasingly remote, and a small subset of those are increasingly asynchronous where they don't care where you are or when you work so long as you get your tasks completed.