kernel_task is still there in Mojave. Restarting will definitely clear things out. You still have to be careful though. There are a few well-known apps that have background processes that will run like mad when you first boot up and fill your RAM with cached files. The only way to break that cycle is to not run that software. The operating system itself does that, but not all at once. That's why you can go a couple of days before restarting.
Generally through, a 2012 iMac was designed for OS X Mountain Lion. At the time, that was considered a significantly bloated OS version as compared to Snow Leopard. It was, at least, an improvement over Lion. These days, Mountain Lion is positively svelte in comparison. Sadly, Mountain Lion has old security protocols and that makes it very difficult to use these days. Mavericks is pretty fast too, but that was the first of the super-buggy OS versions. Mountain Lion corrected many of Lion's bugs and was a remarkably stable operating system. But since Mavericks, there hasn't been a reduction in bugs or an improvement in reliability. It just gets bigger and slower every year. Your 2012 iMac is never going to be any better than "pokey" with a modern operating system. And the mechanical part of that fusion drive is only going to get slower until it stops altogether one day.
8 GB RAM with a fusion drive is pretty much the minimum configuration under ideal conditions. But there is no way of knowing if you have any other software that pushes it to less-than-ideal conditions.