Deprecated since 1.30 (patch, T152540), it's still in use in some stagnant skins and a few extensions:
https://codesearch.wmcloud.org/search/?q=Sanitizer%3A%3AescapeId%5B%5E%5Cw%5D&i=nope&files=%5C.php&repos=
The new methods:
- escapeIdForAttribute()
- escapeIdForLink()
- escapeIdForExternalInterwiki()