If AI makes the per line cost of producing software cheaper but you still need an expensive human in the loop then the per line cost is merely cheap not free or at the cost of electricity.

Given the choice between

A) having one AI produce a library and having 1000 produce code using that library which comes with tests human in the loop vetting documentation and examples which drastically increase the chance of the 1000 AIs doing it correctly

B) Having 1001 produce the same functionality provided by the library probably on average worse and requiring more expensive hand holding

What in that benefit of B? You might have slightly higher specificity to your use case but its more likely that the only increased specificity is shit you didn't realize you needed yet and will have to prompt and guide the AI to produce.

I fail to see how AI would obviate the need to modularize and re-use code.

This take is just an intermediary take until ai takes over software engineering. In the same way, eventually self driving cars will make human drivers look dangerous

I think your thought process is not taking into account what a super logical ai can do, and how effortlessly it could generate some of this code.

> effortlessly

Real question: does your world model suppose super exponential gains in intelligence and efficiency?