Initial block in MyHDL

Is there a recommended way to create an initial block in MyHDL? I found a Stack Overflow article on how to infer one into Verilog, but not how to do something like:

#20
x = 0;
#20
x = 1;

to hack stimulus, etc.

Currently I am just using a counter in a stimulus block, but was hoping for something terser.

Also, it would be nice to not have to keep it around in the scheduler. (This may be a classic case of premature optimization, and still something to help me better understand MyHDL. In my case I am using it for a reset in a toy simulation and as a result, I am also playing with ResetSignal to try to understand exactly what it is doing behind the scenes.)

Perhaps read this first: PEP 20 – The Zen of Python | peps.python.org

I think most MyHDL users write helper functions, as I do. I encapsulated the MyHDL interface into a Structure class where I can add simulation helpers like e.g. an AxiS structure has a method to push a list of data into a device under test and has another method to collect the results coming out of a dut. This makes for very terse (pun intended) but very readable simulation blocks.

Thank you, @Josyb. I am, in fact doing that. Would you be willing to share some of your functions so that I might see some of your helper functions so that I might see some best practices? I am happy to share some of my code; however, it may be nothing more than a great example of what NOT to do. LOL.