If your heads are in the front half of your boat, then a T piece inboard of the toilet inlet stopcock, an inline pump and a pipe up to a deck fitting for a garden hose with an adjustable nozzle. Operating switch fitted where it cannot be fouled near the hose. Water sheds on the foredeck keep the muddy water on the foredeck and not running aft.
There was something like that published in PBO many years ago using a split plastic tube with 3 scrubbing brushes attached inside the tube and a broom handle attached to scrub upand down the chain.