text: Title: `Set Variable If` is slow if it has several conditions
  Body: We have a test suite that has a 28-case `Set Variable If`, viz.
  
  ```
  ${action} The ${element} At Screen XYZ
      ${locator}    Set Variable If    "${element}"=="Element 1"                       ${ELEMENT_1_LOCATOR}
      ...                              "${element}"=="Element 2"                       ${ELEMENT_2_LOCATOR}
      ...                              "${element}"=="Element 3"                       ${ELEMENT_3_LOCATOR}
  etc
  ```
  
  The performance of this is fine if the `${element}` matches a condition high up in the list, but then starts to become very slow for those lower down. Specifically, according to the logs the time to run the few comparisons is around 1ms each, but after a few it starts approximately doubling for each subsequent comparison. In the logs below the time taken for a single comparison reached 9.1 seconds by the time it got to the successful condition, which in this case was the 23rd case of the `Set Variable If`. Some calls in the actual testcase that's using this took even longer as they referenced elements further down the list, with the result that a test suite with fewer than 20 keyword calls overall was nowhere close to finishing even after ten minutes.
  
  I did some profiling by hacking `time.time()` printouts into the Robot Framework source code in my venv. The delay seems to be in the logging code, specifically the `output.listeners.Listeners` and `output.listeners.LibraryLIsteners` classes:
  
  ```
                          before LOGGER.start_keyword: 1696503795.7360394
                              <class 'robot.output.logger.LoggerProxy'> took 3.814697265625e-06
                              <class 'robot.output.logger.LoggerProxy'> took 4.9114227294921875e-05
                              <class 'robot.output.listeners.Listeners'> took 4.5487611293792725
                              <class 'robot.output.listeners.LibraryListeners'> took 4.605533123016357
  ```
  
  (values above are in seconds) - you can see the two classes took 9.1 seconds between them to process the `start_keyword` call.
  
  The first line of the above output comes from a line I added to the very top of the calling function, `output.output.Output.start_keyword`, while the rest of the debug output was generated by changing the `start_keyword` function of the `output.logger.Logger` class to look like this:
  
  ```
      def start_keyword(self, keyword):
          # TODO: Could _prev_log_message_handlers be used also here?
          self._started_keywords += 1
          self.log_message = self._log_message
          for logger in self.start_loggers:
              s = time.time()
              logger.start_keyword(keyword)
              e = time.time()
              print(f"                            {type(logger)} took {e-s}")
  ```
  
  where my changes were to add the `s = `, `e = ` and `print` lines. Unfortunately I was unable to drill down further as I got lost in the maze of runtime-defined functions. My suspicion was that perhaps the XML/HTML loggers might take a while if they have to reshuffle large amounts of XML/HTML in order to insert a nested log about a keyword call - when you view the HTML log for the `Set Variable If`, it is nested 23 layers deep.
  
  Robot Framework version is 6.1.1 (according to version.py), running in Python 3.10.12 on Ubuntu 22.04. The test suite is invoked using the following command `pabot --pabotlib --processes 1 --variablefile local_variable.py --outputdir Log --include <tag> <testcase root directory>`.
  
  Happy to supply any other info, screenshots etc to help. The problem is readily reproducible on my end and for now I'm going to work around it by splitting up the keyword into several keywords each with a smaller `Set Variable If`.