refactor: clean up code to py39+ supported syntax
- f-strings instead of format
- latest typing support instead of pre 3.9 TitleCase
- remove UTF-8 declarations.
- many more changes
Powered by https://github.com/asottile/pyupgrade/ + manual cleanups
* Fallback to insert in realtime if redis conn fails
* Allow List and str inputs for deferred insert API
* Set doctype value unconditionally in insert_record
* Use frappe.logger instead of print
* Add type hints