Since it is common to want to return JSON data from tasks, and since it can be problematic to build inline JSON given escaping / formatting rules, there should be a facility always available for task authors to produce JSON from PowerShell.
Normally this can be done using PowerShell 3 and above using the ConvertTo-Json and ConvertFrom-Json cmdlets. However, Bolt and PE tasks explicitly support PS2+ so for PS2, a polyfill is necessary to make these cmdlets available. Bolt code already does something similar for its own purposes at https://github.com/puppetlabs/bolt/blob/a53f2f872a82b2a5ba6a4d8961243f2cb7c1ce1f/lib/bolt/transport/winrm/connection.rb#L205-L380 as does the implementation of PE tasks at https://github.com/puppetlabs/pxp-agent/blob/33a76e0080e61b353dff9fbf17e4dbede44bd09b/exe/PowershellShim-Helper.ps1 . These facilities just need to be surfaced to end users.
Otherwise, if users wish to write PowerShell tasks that support all PowerShell versions, they must build inline JSON strings.