This is likely "not" attention seeking behavior, and the behavior likely has nothing to do with a desire to annoy the parents or break the toilet by flushing objects down. He is Iikely not trying to be funny. They seem in their own world and are either exploring or doing what feels natural for them, or trying to relax and make sense of things..
This sounds sensory related, the tight fit need and possibly preoccupation with the sight or sound of water going through pipes, etc.
Our very small youngest eleven year old has problem solving skills and is not attention seeking, yet he is not only obsessed with flowing water from faucets and through pipes, watching and listening to it and trying to find out where it comes from and goes, but also loves a close and snug feeling of being in oversized boxes, cupboards, closets filled with items, and sitting partly in an open washer.
Although he is often sitting next to us too on the couch and loving that contact and climbing over us and wanting to be held, it is not necessarily for attention as he gets much of that, but a sensory need to feel pressure next to him and a close, comforting fit or warm connection. Of course we won't sit next to him all day long as he and we need our independence too. He needs a weighted blanket on him at night too or else he won't sleep.
So, whether the child has one issue or two, it seems likely sensory related to me from the little known so far. Some of the advice given like to divert attention away from the toilet when he does that and to replace the sensory need or preoccupation with a somewhat similar routine sounds better, like turning on the water faucet to wash his hands with soapy bubbles, sliding water or small toys objects down through a long plastic chute container, sitting in a large container or box, until you find out his sensory need, etc.
Stern lectures and critiquing the child with such likely sensory issues is not my answer to stop such, if these are not neurotypicals who try to play emotional or test your limit games with their parents. They are not going to stop any such sensory need from happening again necessarily because of tough parenting or we love you stuff. Finding other items instead without germs, to provide him that stimulation, with a reminder that potties are for sitting only for those other hygiene activities, and being assertive there in not allowing that but giving another choice instead if health or sanitary issues are at stake.
Kids like this could be your next engineer. They are far from being dopes.