I had a mariner 40 that did exactly the same thing and it was a combination of pretty much everything mentioned above!
To start with I took off the carbs, gave them a good clean out to get rid of all the sediment left in the fuel bowls, then replaced them, then when it was running tweaked the mixture screws, that really sorted it out. Once it was running well then gave a squirt of the carb cleaner.
It sounded beautiful after that!
Recommed starting with mixture screws tho!