No need for pure FP or monads I believe. Consider statically analyzing the library for:
1. `unsafe`
2. import/use of any ambient effects (std::fs::open etc; good enough to have a much smaller allowlist). allow using methods on passed-in &std::fs::File but do not allow std::fs::File::open. beware anything making openat a method on File. Making this realistic may need new API conventions. WASI is doing some of this work already.
3. apply recursively to dependencies
Now the library can only operate on the things passed in to it.
Much preexisting source won't qualify, but e.g. PNG decoding should.