The case to look at is for parameter values being used when performing an apply. This problem does not occur when the compilation is remote (due to serialization of catalog in between compile and apply).
Josh Cooper Can we stop doing this in Puppet 6.0.0? It means that functions and type & providers that mutate frozen string arguments will hit a hard error when using puppet apply. It will also make 3.x functions that do this error when compiling (If attempting to mutate arguments in a 4.x function it will already error if argument is frozen).
As per the discussion in the PR a decision was made to stop duplicating frozen strings both on master side and agent. This affects some modules - and ticket PUP-9098 was logged for the modules in puppet that has affected logic. I also reached out to one forge module that has the same problem: https://github.com/thecodeteam/puppet-vnx/issues/10.
This now again ready to be merged for Puppet 6.0.0.
Types and Provider implementations must not mutate the parameter values of a resource. In Puppet 6.0.0 it is more likely that the parameters of a resource will have frozen (i.e. immutable) string values and any type or provider that directly mutates a resource parameter may fail. Before Puppet 6.0.0 every resource attribute was copied to not make application break even if they did mutate. Look for use of {{gsub!}} in your modules and replace logic with non mutating version, or operate on a copy of the value. (All modules authors of modules on the forge having this problem have been notified).
New PR is up with a removal of the dup when in master mode (i.e. what I originally had). That works because only core resource types are used on the master side (applying the settings catalog) and those in Puppet core that did mutate have been fixed already. If we find code in our code base that mutates and runs into problems with that because of this then that code should be fixed - it is really bad to mutate.