Not in the traditional sense. What you can do is create a passage with the code you want in it, then (display:) the passage. You'll need to create a variable to pass information to the passage if it needs to evaluate something.
A couple examples:
A passage named "func:hero health" which displays a variable (with a text effect):
{(text-style: "emboss")[(print: $heroHealth's (round: $heroHP))]}
Called with
(display: "func:hero health")
For something more complex, a menu item which takes the player to the version history document (used as a menu item):
{(text-colour: "$gameColorCodes's w3-pink")[(link: $menuPassageNameForGoTo)[
(if: (passage:)'s name is 0)[
(set: $gamePreviousPassage to "main")]
(else:)[
(set: $gamePreviousPassage to (passage: )'s name)]
(goto: $menuPassageNameToGoTo)
]
]}
Which I call and pass variables to with:
{(set: $menuPassageNameToGoTo to "doc:version history")
(set: $menuPassageNameForGoTo to "Version History")
(display: "func:left menu goto passage")}