Knowing the nature of the changes, I don't expect that the Moodle 4.x changes would have a significant impact on performance when a student attempts a quiz. Certainly, these changes have been out in the wild for smoe time, and we have not had many other similar reports. Also, lots of other things have canged in Moodle 4.x which might affect performance.
But, really, with performance issues, it is no good guessing. The only way to work out what the real cause of slowness is, is to measure. If you can do some profiling. That normally reveals what is causing the slowness. Instructions on how to get started here: https://moodledev.io/docs/4.5/guides/profiling
But, really, with performance issues, it is no good guessing. The only way to work out what the real cause of slowness is, is to measure. If you can do some profiling. That normally reveals what is causing the slowness. Instructions on how to get started here: https://moodledev.io/docs/4.5/guides/profiling