The unsafe block in question: https://github.com/MCHPR/MCHPRS/blob/f8b7b03b1cc09740437b1215cdcfbf13dde3e4fb/crates/redpiler/src/backend/direct/mod.rs#L153..L156
This unsafe block can be avoided at no extra runtime cost by using a new type instead of u8 for signal strength.
Proof of concept: https://godbolt.org/z/Kbs7arcKh