The standard arithmetic classes of Isabelle/HOL show that you can extend division with the equation `x / 0 = 0` and things (seemingly) work out.
https://lawrencecpaulson.github.io/2021/12/01/Undefined.html
https://www.hillelwayne.com/post/divide-by-zero/
https://xenaproject.wordpress.com/2020/07/05/division-by-zer...
You'll need to do some thinking/proof to find out if it works for you.