bpo-34427: Fix infinite loop when calling MutableSequence.extend() on self (GH-8813)

diff --git a/Lib/_collections_abc.py b/Lib/_collections_abc.py
index dbe30df..c363987 100644
--- a/Lib/_collections_abc.py
+++ b/Lib/_collections_abc.py
@@ -986,6 +986,8 @@
 
     def extend(self, values):
         'S.extend(iterable) -- extend sequence by appending elements from the iterable'
+        if values is self:
+            values = list(values)
         for v in values:
             self.append(v)