Revert "Optimize apply_slack for size and speed"

This reverts commit 2d3758a0ba34f28a78fffd76299269de2771df77.