Really depends on the type of troll you're dealing with.

First off, it's important you don't do this alone. Trolls get under your skin and if you get emotional, you're going to make bad calls. Have at least three other mods that you are in constant communication with (via forum-PMs, IRC or other messaging). They also help lighten the load of doing boring non-automatable parts of cleanup jobs. Try to set hard and clear rules of how to act before the situation occurs.

So, there's the crackpots (on a spectrum from deserving-compassion-because-mentally-ill to dangerously-obsessed). There's the spammer-trolls (commercial non-human spambots, human marketers, but also people with a grudge that want to flood threads out of spite, both manually or using tools). Then there's the "classic" trolls that use psychological tricks to push hot-buttons and try to sow discord and strife in the community. There's probably a few more categories but most trolls are some combination of the above.

I'm not really counting users with "objectionable speech" such as racists or (perhaps forum-specific) controversial topics. If it's controversial but (somewhat) on-topic, it's for the community to deal with. If it's off-topic (perhaps for a particular subforum), it's your basic moderator-janitor clean-up job to delete, split, or move. If that's too much work, either man up about it (clean-up is going to suck sometimes, you can't automate everything, but maybe you can automate more), or confer with the other mods whether to treat this troll as a spammer. It probably helped a lot that a good number of the regular users of "my" old forum are very experienced in the ways of the "classic troll", yet level-headed and relatively good people, so the community has a healthy "immune system". But if the community itself can't actually deal with that kind of noise (at least "don't feed the trolls") and relies purely on the moderators to shelter them from "objectionable speech", then you're going to get an echo chamber either way, and I didn't sign up to moderate that :-) Unless it's a forum that mainly hosts under-age kids or other vulnerable categories, that's different. I don't have experience with that, but it's reasonable to expect that bad actors will cause you disproportionate amounts of effort to deal with (shadowbans or no).

Trolls also come in categories of "being really really annoying", "being dangerous to forum users" and "actually damaging the forum itself". Being very clear (among the mods) about which category a troll (currently) falls under already helps showing the path how to deal with them.

I've got to be honest here, if a troll clearly is of the "damaging" type, then IMHO all bets are off and yeah sure you can also use the unethical methods of sanctioning, including the shadowban if you must. The threshold for this is somewhere among the "spammer" category, but if it's someone that turned from "objectionable" to "grudge spammer", discuss and think long and hard and probably reconsider to find a different way. I don't think the shadowban is the most effective tool in this case, a slowban (increasing page-load times) usually works a lot better. Note that I also consider the slowban an "unethical" tool, for the main reason you're not telling the user it's activated. That's the biggest problem I have with such, if the user doesn't know they're being sanctioned they don't know to change their behaviour either, by being better or by leaving. If you apply a "hidden" sanction to a user, you MUST do it with the sole intention that you NEVER EVER want to see this person on the forum again, a very serious decision to make, be very certain that the other methods of banning (account ban, IP ban, or other creative options to prevent them from re-registering) were tried several times and did not work, and that this method WILL work in making them leave. It can't be set-and-forget either, monitor and check if they actually leave, if a user is in shadowban-land for a month and is STILL writing posts, that's ON YOU, you are wasting the life of an actual person, that someone who is apparently not entirely right in the head if they don't notice nobody reads their shit. That is a very sad situation and you should consider this. These are hard decisions to make and that is when you need the mental support of the rest of your mod-team. I find that a slowban is much less likely to lead to this situation. Another thing, why again I think that in nearly all cases you should NOT do this, is if the person is not as stupid as a bag of nails and they find out. In case of a shadowban they find you've wasted their time and effort for a very long time, and they have a very good reason (imho) to be very angry about that because it's a dick-move. Some will then double-down on their efforts.

... okay this post is taking quite a bit more time than I expected and I haven't even really gotten to the "what to actually do"-parts :-)

I can continue answering your question (another day) if you like, but please first let me know that you've actually read the above, because I'm answering a 3-days old post, HN has no reply-notifications, and I don't want to spend my time writing to the void (... which would be strangely appropriate, given the subject that prompted this, hahaha ;-) )