I've heard of sites being so badly programmed that basic features are a huge drain on resources. For example, there was one site where, any time a popular user made a post, it caused a lag spike as the server generated the thousands of notification messages for all their followers. The only way they could think to fix it without overhauling the UI was to reprogram it to generate the notifications in smaller batches over a longer period of time.
But that was a site designed and coded by complete amateurs in their free time back in the early 2000s. Twitter at least used to have a staff of competent professionals working for it. Unless Elon demanded that the entire codebase be rewritten during the brief time he's been in charge, he's more likely talking out of his ass and just trying to stop people from blocking him and his cronies.