40mm doesn't seem too long for an aluminum steerer. Check the fork and headset documentation to see if there are any limits for spacers above the stem.
For a carbon steerer 40mm is generally too long. (Many carbon steerers require 5mm above the stem)