Due to quirks with how QSTRs are passed, conditionally including a function is difficult. Instead, always include "get_shift_state" but throw a RuntimeError if its use is invalid (no shift register).