Postgres 12: declare a function as constant or immutable ignoring parameters?
Declare the no-op version as an SQL function then it will be in-lined as a constant value by the optimiser.

CREATE OR REPLACE FUNCTION notify_conditionally(channel text, payload text) RETURNS int
LANGUAGE sql AS
$inner$
SELECT 0;
$inner$;