I don't know, I adapted the fix from github.com/avidal/django-pyodbc as it was :-/. It was there. I guess it's safe to remove, I just tested that it works for me.
By the way, if you look into SQLInsertCompiler class, there is the string:
        # Fix for Django ticket #14019
        if not hasattr(self, 'return_id'):
            self.return_id = False
I think it should be that way in SQLInsertCompiler2 class too.