Just as short as you can make it to get the job done. Stretch it out a bit too to make it as smooth as possible inside. If it can't be straight try to make the curves as wide as possible without adding a lot of length. 90° bends take up to 10%. If you do get a carbon filter get a bigger one made for 6" and buy an adaptor to fit it on. Much less restriction with the larger surface area and the filter will last for ages. If you don't need one so much the better.
If it's in your budget get a temp/humidity and speed controller for the exhaust fan. Then your fan only runs when needed and a lot quieter with the speed down half way.