It's not perfect, it'd be great if everyone could have a work sample but as you say that's just not the world we live in.
The reasons I don't like long coding assessment projects and the reasons I don't already have an example code profile are the same. Reinventing all the same wheels in different programming languages just isn't as fun for me as it once was, and I don't have as much time to dick around with any specific side project, especially ones that don't have any immediate utility to me or my family.
Does anyone ever ask about how I spec'd, designed, built, installed, and maintained my DIY entertainment center? No. Same methodology as building software, you know, except the problems are solved with different tools from a different toolbox.
If you're truly really looking for someone "T-shaped", you have to realize that the tittle on that T might include things entirely outside the realm of software or computer hardware, like how to hang a bear bag when camping, or how to fly a small single-engine aircraft, or how to train cats to use regular toilets, or how to run for political office, or what to do when you get a flat tire, or how to hold someone else's baby, or how to hit a gong target from 300m, or how to make a longbow for under $10 at Home Depot, or how to report a pothole so the city will fix it, or how to repair a pothole when the city won't do it, or how to play "Flight of the Bumblebee" while slowly rotating your B-flat concert tuba through 360 degrees.
All those miscellaneous, general-purpose skills do, in fact, make someone more effective at quite a lot of software-related tasks, sometimes in unexpected ways. But they are never going to appear on a resume, or crop up in the answers to any of the stock interview questions. When you include a criterion that specifically selects for people whose after-work hobbies also involve software, you are implicitly selecting against those who do other things, because there is much, much more to life than writing code.
There was only a very narrow slice of time when I actually wrote code for fun in my free time, from the ages of 15-25. It basically stopped after I got laid off from my first software job, and interviewing for software jobs became my next full time job. That's when I realized that I needed to do other things in my life, because it didn't matter how much I loved software if it didn't love me back.
So if you think need a portfolio to get a job, you might want to build one up that includes more than just code samples. The software industry does not love you back. It will move on to someone younger when it gets bored of you.
Systems, problem solving, engineering. Happens everywhere not just on a computer screen.
Otherwise I agree with what you said, and the best way to tease those details out of a candidate is to have an informal, personal discussion like getting lunch or getting beers together. But that's not enterprise scale.
I'd say 8 hours is too long. I always strive for a 4 hours, but I've seen that 4 hours chop 16 hours off of the candidates time and more than 32 off of the companies.
> What's the point of maintaining an online portfolio and a github profile full of code
The vast, vast, vast majority of candidates do not have an online profile full of code. Either because their code is IP restricted or they do not have time outside of work to maintain that. I view using online profiles as a decided anti-pattern in hiring on the company side as it restricts your candidate pool to a tiny subset of the community that I've seen no evidence provides any more value in outcome and its much more prejudicial to the candidate population than any coding assignment can ever be.