Restrict `static mut`

This is an alternative to #177.