[lldb] Decode debuggee bytes to Python str with "replace" (#224010)

Reading a C string that is not valid UTF-8 raises `SystemError`, even
though
the read succeeded and the `SBError` reports success:

```
(lldb) script
>>> process.ReadCStringFromMemory(addr, 2048, lldb.SBError())
SystemError: <built-in function SBProcess_ReadCStringFromMemory> returned
NULL without setting an exception
```

The `argout` typemap built the result with `PythonString`, which
requires
valid UTF-8. On failure `PythonString::SetString` consumes the error,
and
`PythonException`'s constructor has already called `PyErr_Clear()`, so
the
typemap returns `nullptr` with no exception set.

Bytes read out of a debuggee are arbitrary, so decode them with the
"replace" error handler: undecodable bytes become U+FFFD instead of
failing.
Valid UTF-8 decodes as before. "surrogateescape" would keep the bytes
exactly
but raises `UnicodeEncodeError` when printed, which only moves the
failure.

This also covers `GetSTDOUT`, `GetSTDERR` and `GetAsyncProfileData`,
which
share the typemap, and the sibling typemap used by `SBFileSpec::GetPath`
and
`SBThread::GetStopDescription`, where a path or a target-supplied thread
name
is likewise not guaranteed to be UTF-8.

Assisted-by: claude
GitOrigin-RevId: 298d3ac7533414b285be30b903f767038073289b
4 files changed