To kill the caterpillars before composting you could chop up the afflicted cabbage. We always just throw the damaged produce all in - assuming in a thriving ecosystem, there are predators to also eat and dispose the pest.Cabbage butterflies are forever with us - I don't think killing them before composting will make a difference. Also slugs damage our cabbage big time when the weather is damp enough. And they surely find and live in every compost pile around, just helping to process any discarded vegetables.
Growing under row cover is another way to avoid the damage, but BTk is effective and a great save when you find them on your crop.