You don't have to implement totp for these alternatives... The "thing" about totp is that there's a shared secret and a timestamp. Due to potential drift in clocks you need a window and period to know how many time steps to test, and how long each is.
But with an email/SMS/WhatsApp, there's no shared secret. So you can simply send a random code, and store server side when it was generated. Totp makes no sense in that case.
Not that totp is difficult to implement at all. My implementation for work was what, less than 200 lines of C++ I think? I didn't implement the sha1 myself though.