`$!` isn't threadsafe; it would be better explicitly grab the rescued exception like so:

```ruby
begin
  number = number.to_s
rescue NoMethodError => ex
  raise Puppet::ParseError, "num2bool(): Unable to parse argument: #{ex.message}"
end
```