An entire category of bullshit jobs would be created to write "source code" that met the regulatory requirements but had little connection to the actual code deployed in production. This code would largely be derived from the claims, and, like much patent language, be crafted to be as vague and general as possible. Most of this work could be automated by ChatGPT, as no insight is required. Another class of bullshit jobs would be created to interpret and analyze the code, as it's outside the skill set of lawyers and examiners.
Any code published as part of a patent would immediately be anti-open source, as people actually creating things would be strongly discouraged from even looking at it, as doing so would support "willful infringement." The average level of code quality would be such that nobody would want to, anyway.
There's lots that could be done to make the patent system more beneficial to society (including, in my personal opinion, dropping software patents entirely), but I don't think a code requirement would be particularly helpful.