dbus-escape-as-identifier is a compiled Lisp function in `dbus.el'.

(dbus-escape-as-identifier STRING)

Escape an arbitrary STRING so it follows the rules for a C identifier.
The escaped string can be used as object path component, interface element
component, bus name component or member name in D-Bus.

The escaping consists of replacing all non-alphanumerics, and the
first character if it's a digit, with an underscore and two
lower-case hex digits:

"0123abc_xyz\x01\xff" -> "_30123abc_5fxyz_01_ff"

i.e. similar to URI encoding, but with "_" taking the role of "%",
and a smaller allowed set. As a special case, "" is escaped to

Returns the escaped string. Algorithm taken from
telepathy-glib's `tp_escape_as_identifier'.