Mitigating Overthinking through Reasoning Shaping