Well, that was really easy (not surprisingly) to implement in PDBTools. Now you can do (with version 0.12.12, which will be available at any moment):
julia> using PDBTools
julia> seq = "ATVR"
"ATVR"
julia> mass(Sequence(seq))
427.4986
julia> seq = ["ARG", "THR", "GLU"]
3-element Vector{String}:
"ARG"
"THR"
"GLU"
julia> mass(Sequence(seq))
386.4036
It does not handle terminals in any sense, it is just the sum of the average mass (isopically speaking) of the amino acid residues in the sequence.