I will engage with your claim that coding tests aren't making it hard to find developers. I think it is a more important factor than you do.
On a personal level, coding tests are a deterrent for me in applying for new jobs. I have my old copy of data structures and algorithms, and I've gone through "Cracking the Coding Interview." I actually enjoyed it at first. They're interesting and challenging problems. If there were an exam - maybe something similar to the actuarial calculus or probability exams - I'd probably be interested in studying hard for it and passing it.
However, I'm no longer interested in re-loading this information into short term memory in order to take a whiteboard exam. This may be a facet of how my own brain works vs others. I just don't walk around prepared to figure out which elements of a set, when combined after permutation, are equal to an existing member of the set. Or how to find all square sub-matrices with a positive determinant in a larger matrix. I can do these things - I've enjoyed doing them - but for me, it takes a lot of training and prep to re-load it in a way that I'm ready for the 45 minute whiteboard exercise. If it were a proper, lasting exam, I'd be happy to do it, but it's just too random, uncertain, and capriciously scored for me to want to do it anymore. I will note that some people don't have thae same trouble I have with this, and - I really mean this - this may actually indicate that they are better candidates than I am. In short, I need to acknowledge that I may certainly not be the "talent" that anyone is missing out on.
Money makes a difference too, but the reason I brought up Wealth of Nations is to draw your attention to the section "Of Wages and Profit in the different Employments of Labour and Stock" http://geolib.com/smith.adam/won1-10.html
I would recommend the entire article, as Smith breaks down the various factors that can lead to higher or lower wages, but you don't really need to read the whole thing, here's smith's summary:
"THE five following are the principal circumstances which, so far as I have been able to observe, make up for a small pecuniary gain in some employments, and counterbalance a great one in others: first, the agreeableness or disagreeableness of the employments themselves; secondly, the easiness and cheapness, or the difficulty and expense of learning them; thirdly, the constancy or inconstancy of employment in them; fourthly, the small or great trust which must be reposed in those who exercise them; and, fifthly, the probability or improbability of success in them."
Within this matrix, software engineering does have a lot to recommend it. For example, Law requires a very expensive and lengthy graduate degree, whereas software engineering doesn't, even though most successful SE's generally do have some kind of undergraduate, and often graduate, degree in rigorous fields that require a lot more math than law. How people will respond to this (along with other aspects of these two fields) depends a lot on their own personal wiring as well.
Within this matrix, yes, I do think that many people find in person, oral exams, at a whiteboard or at a computer under scrutiny and time pressure, on topics that they often don't know well in advance, evaluated by people whose credentials and skill they don't know in advance... yes, I think many people find that a deterrent, either for applying for new jobs, or entering the field in the first place. Many people consider these on-the-spot exams extremely stressful, especially when they are in person, at a whiteboard. And we go through days of it, and a new round of study, every time we apply for a jbo. Tech interview exams are not the only factor making it harder to attract candidates, but neither are any of the multiple factors identified and elaborated on by Smith. But I absolutely believe they are a factor.