Would it be feasible to create a type which signifies that unsafe computation has happened? Like the IO Monad in Haskell, for example. This type would have to have a constructor that wraps a value and no way to take the value out of the type.
That way, any code “infected” by unsafe computation will also be infected by the type.