As the column 'kmh' shows speed limits wrong for my city, and I didn't want to modify the configuration file of osm2po for each type of road, is there a way to change the cost function? I wish:
cost= length
and not
cost= length/kmh
As you tagged your question with pgrouting
I assume you want to use osm2po to generate the PostgreSQL tables. So why don't you update your database table after import?
UPDATE <table> SET cost = ST_Length(geom_way);
And if you prefer the length in unit meter, then you can transform the geometry into some Mercator projection:
UPDATE <table> SET cost = ST_Length(ST_Transform(geom_way,3857));
or just
UPDATE <table> SET cost = km
and don't forget to set the reverse_cost if needed.