May I humbly submit that you can learn just about everything you can in a "k-12" education for free, or near free from places like khan academy. You can even learn to code there for free.
Maybe it would be more cost effective to transition from brick and mortar institutions and shift to major funding of services like these.
I can see quite a few potential benefits from doing so, such as the fact that the quality of teaching and quantity would improve exponentially.
Teachers could spend less time manually grading physical papers, for example, because of paid for services like Grammarly that can spot errors faster than any human.
Teachers would also spend less time manually giving lectures by group defining and perfecting curriculums and lectures. They are experts in their fields, but they are human so they can make errors every time from mid-lecture to question and answer sessions.
Less time in class and lectures also would benefit the students. They would be able to spend more time being nurtured by their own parents, and at liberty to learn at their own pace, and to their own passions.
This all is not to say that brick and mortar institutions would not be needed, but this would create a situation where more quality care could be given to the in-house learning of students who are, in one way or another differently abled or incapable of efficiently learning in the current force-structure system which marginalizes them into out of the way cramped and crowded special education rooms.
Why should we force gifted students to memorize, write down, and recite wrote math at the age of seven when this keeps them from solving complex algorithmic problems at the same age, mostly in their head?
"Outsourcing" gets a terrible rap these days, but there simply is no room for anything other, when you outsource into the freedom of choice. "Choice" is the freedom to grow, to accomplish, and to create unto your own ends, WHATEVER they may be! Be it farming, to launching the next trip off world, people should be treated as uniquely as every passion in between. Open source is the future. The current education system will never allow for this because it sees people not as works of Da Vinci or Beethoven, to be composed, but as hammers and scythes to be forged; Not with destinies, but tools to be used until broken and cast aside.
If you only see this as a money issue, you need to reframe your perspective.
You aren't the problem, your frame of thinking is.