Minecraft wiki entry for Defeating_a_bastion_remnant, associated text: Attack the big magma cubes first. This is because they have high health, do heavy damage, and jump high enough to knock players off 3-block tall pillars. The other magma cubes are much less dangerous, and can easily be killed in one hit with a decent weapon from atop a 3-block tall pillar.
Summoning iron golems is almost a perfect solution. Because they are immune to slimes and magma cube damage (knockback too), and deal massive damage, this is a good approach. But one problem: Lava. The area where magma cube spawners exist is filled with lava, which iron golems avoid and take damage in.
If you don't have those kinds of resources, consider shooting them from afar. You should be far enough away to kill all of them before they make their way to you.
You can fill in their lava pool piecemeal, making the area much safer. A potion of fire resistance can also help.