Replace assigned lambdas with local functions so Ruff can enforce E731.
For platform-specific immutable file cleanup, store the command as data
instead of creating conditional callbacks.
This refactor makes the ruff.toml easier to read, because it lists the
ignored checks instead of having to enumerate all checks to select in a
large collection of rules.