Ignore Note Offs Toggle Question

Can this be done without going to preferences and be mapped to a shortcut key?

Can a script be made to do this if not?

Not possible and not plausible.
Note offs are required to prevent things from going beserk.
You can write a script to control note-on and velocity and then allow it to ignore note-offs, but the Lua script will perform with a lot of unreliabel delays i don’t think you would like the outcome very well.