diff --git a/core/lib/Drupal/Component/Utility/SafeStringInterface.php b/core/lib/Drupal/Component/Utility/SafeStringInterface.php
index 136dd37..ac251fa 100644
--- a/core/lib/Drupal/Component/Utility/SafeStringInterface.php
+++ b/core/lib/Drupal/Component/Utility/SafeStringInterface.php
@@ -43,4 +43,14 @@
    */
   public function __toString();
 
+  /**
+   * Returns a safe string.
+   *
+   * Same as __toString but with less fatals.
+   *
+   * @return string
+   *   The safe string.
+   */
+  public function toString();
+
 }
diff --git a/core/lib/Drupal/Component/Utility/SafeStringTrait.php b/core/lib/Drupal/Component/Utility/SafeStringTrait.php
index a91e44b..29ddf21 100644
--- a/core/lib/Drupal/Component/Utility/SafeStringTrait.php
+++ b/core/lib/Drupal/Component/Utility/SafeStringTrait.php
@@ -54,6 +54,16 @@ public static function create($string) {
    *   The safe string content.
    */
   public function __toString() {
+    return $this->toString();
+  }
+
+  /**
+   * Returns the string version of the SafeString object.
+   *
+   * @return string
+   *   The safe string content.
+   */
+  public function toString() {
     return $this->string;
   }
 
diff --git a/core/lib/Drupal/Core/StringTranslation/TranslationWrapper.php b/core/lib/Drupal/Core/StringTranslation/TranslationWrapper.php
index 6bf591a..ccb5c9b 100644
--- a/core/lib/Drupal/Core/StringTranslation/TranslationWrapper.php
+++ b/core/lib/Drupal/Core/StringTranslation/TranslationWrapper.php
@@ -98,6 +98,13 @@ public function getOptions() {
    * Implements the magic __toString() method.
    */
   public function __toString() {
+    return $this->toString();
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function toString() {
     return $this->render();
   }
 
diff --git a/core/lib/Drupal/Core/Template/Attribute.php b/core/lib/Drupal/Core/Template/Attribute.php
index 8fe6788..efe6df7 100644
--- a/core/lib/Drupal/Core/Template/Attribute.php
+++ b/core/lib/Drupal/Core/Template/Attribute.php
@@ -253,6 +253,13 @@ public function hasClass($class) {
    * Implements the magic __toString() method.
    */
   public function __toString() {
+    return $this->toString();
+  }
+
+  /**
+   * @inheritdoc
+   */
+  public function toString() {
     $return = '';
     /** @var \Drupal\Core\Template\AttributeValueBase $value */
     foreach ($this->storage as $name => $value) {
diff --git a/core/lib/Drupal/Core/Template/TwigExtension.php b/core/lib/Drupal/Core/Template/TwigExtension.php
index 482c888..c813e5e 100644
--- a/core/lib/Drupal/Core/Template/TwigExtension.php
+++ b/core/lib/Drupal/Core/Template/TwigExtension.php
@@ -490,6 +490,9 @@ public function renderVar($arg) {
     }
 
     if (is_object($arg)) {
+      if ($arg instanceof SafeStringInterface) {
+        return $arg->toString();
+      }
       if (method_exists($arg, '__toString')) {
         return (string) $arg;
       }
diff --git a/core/tests/Drupal/Tests/Component/Utility/SafeMarkupTest.php b/core/tests/Drupal/Tests/Component/Utility/SafeMarkupTest.php
index 1278a6d..5378260 100644
--- a/core/tests/Drupal/Tests/Component/Utility/SafeMarkupTest.php
+++ b/core/tests/Drupal/Tests/Component/Utility/SafeMarkupTest.php
@@ -245,6 +245,10 @@ public function __toString() {
     return $this->string;
   }
 
+  public function toString() {
+    return $this->string;
+  }
+
   public static function create($string) {
     $safe_string = new static($string);
     return $safe_string;
