WITH
  FUNCTION sum_digits(p_in_str IN varchar2) RETURN varchar2 IS
  v_in_str VARCHAR(32767):= translate(p_in_str,'*-+','*');
  v_sum INTEGER;
BEGIN
  --
  IF regexp_count(v_in_str,'[0-9A-F]',1,'i')=LENGTH(v_in_str) THEN -- base 16
    EXECUTE immediate 'select sum('||regexp_replace(v_in_str,'(\w)','to_number(''\1'',''X'')+')||'0) from dual' INTO v_sum;
    --   
  elsif regexp_count(v_in_str,'[0-9]',1,'i')=LENGTH(v_in_str) THEN -- base 10 
    EXECUTE immediate 'select sum('||regexp_replace(v_in_str,'(\d)','\1+')||'0) from dual' INTO v_sum;
    --
  ELSE
    RETURN 'Sum of digits for integer  not defined';
    --  
  END IF;
  -- 
  RETURN 'Sum of digits for integer  = '||v_sum;
END;

--Test
SELECT sum_digits('') AS res FROM dual
UNION ALL 
SELECT sum_digits('000') AS res FROM dual
UNION ALL 
SELECT sum_digits('-010') AS res FROM dual
UNION ALL
SELECT sum_digits('+010') AS res FROM dual
UNION ALL 
SELECT sum_digits('120034') AS res FROM dual
UNION ALL 
SELECT sum_digits('FE') AS res FROM dual
UNION ALL 
SELECT sum_digits('f0e') AS res FROM dual
UNION ALL
SELECT sum_digits('st12') AS res FROM dual;