MCM are not strong if the tail variance isn't an important feature of what is being modeled. I've seen simulations where the modeler starts with an analytic model - from which they could trivially calculate the mean and variance of a KPI - then used a MCM simulation to find out essentially what the mean and variance of the KPI.
So I get that this code is just for illustrative, educational purposes. That is fine. Well done Christof, thanks for the contribution to education. But if anyone is actually using MCM to simulate well known probability distributions they should really put the effort in to learning how to work with well known probability distributions. I feel pretty confident that simulating the Bernoulli in a professional setting is a mistake, because I've seen it done and it was a mistake. For amateurs who aren't confident with math then they can use MCM if they like; but statistics is dangerous and they should be aware that they are using the wrong tool for the job and it is a tell they will get other things wrong. You get a lot of insight from a good analytic model.
If there is some interesting tail issue (eg, maybe after 3 heads there is guaranteed to be a tails and your insurance contract pays out on a tails) then sure, use MCM. Great tool if you have the right problem.