sanitizeAsIdentifier
Sanitizes this string for use as a stable, anchor-like identifier:
Strips characters that are problematic in CSS selectors and URL fragments (whitespace, quotes, angle brackets, ampersands).
Ensures the result is not empty: an empty input becomes
_.Ensures the result does not start with a digit by prepending
_when needed (see issue #86).
Return
a safe identifier string, possibly different from the original