The fact that you came here asking for help is evidence that globals don't scale. In theory there are times they're ok, but do you know how many times I've needed them? Zero. I've been coding since 2005 and working professionally for the last six years and I've never used one, in any language, and if I submitted code for review using one, it'd never get approved. You know what happens when I interview people and they use a global? 100% of the time, there's a bug. I'm not exaggerating when I say 100%. I've done hundreds of interviews and using a global was only ever bad.
You may have struggled with classes and other methods of removing globals, but they are 100% worth it. With 4k LOC full of globals, I'm certain you have bugs that you don't know about. Testing code with globals is difficult, so you may not know they're there, but I'm certain unless every author of that code is cleverer than anyone I've ever met. I'm not going to continue trying to convince you, I'm just telling you: millions of programmers before you have regretted using globals, and you have an opportunity right now to learn from all those mistakes, instead of making the exact same ones on your own and coming to the same conclusion anyway.
You may have struggled with classes and other methods of removing globals, but they are 100% worth it. With 4k LOC full of globals, I'm certain you have bugs that you don't know about. Testing code with globals is difficult, so you may not know they're there, but I'm certain unless every author of that code is cleverer than anyone I've ever met. I'm not going to continue trying to convince you, I'm just telling you: millions of programmers before you have regretted using globals, and you have an opportunity right now to learn from all those mistakes, instead of making the exact same ones on your own and coming to the same conclusion anyway.